Forumi
Home Pravila i pomoć Članovi Kalendar Današnji postovi


Povratak   PC Ekspert Forum > Računala > Software > Operativni sustavi
Ime
Lozinka

Odgovori
 
Uređivanje
Staro 07.05.2024., 20:55   #3211
mkey
Premium
Moj komp
 
Datum registracije: Sep 2018
Lokacija: tu
Postovi: 1,961
Ma stvar je u tome što svako toliko imam potrebu za pripremiti neki environment. Kao npr relativno nedavno gap engine sa python2 gdje sam hrpetinu paketa ručno instalirao da to osposobim. Volio bit takve stvari imati u nekakvom containeru tako da kada instaliram hrpu sranja da to bude odvojeno od operativnog.

Pa sam tako gledao neke distribucije koje dolaze sa distrobox i varijantama istog. Samo što takve kombinacije nisu standard i to održava neki lik koji ima 17 godina pa napravi kad stigne. Nije baš neki standard.
__________________
Citiraj:
Autor George Carlin
But there’s a reason. There’s a reason. There’s a reason for this, there’s a reason education sucks, and it’s the same reason that it will never, ever, ever be fixed. It’s never gonna get any better. Don’t look for it. Be happy with what you got. Because the owners of this country don't want that. I'm talking about the real owners now, the real owners, the big wealthy business interests that control things and make all the important decisions. Forget the politicians. The politicians are put there to give you the idea that you have freedom of choice. You don't. You have no choice. You have owners. They own you. They own everything. They own all the important land. They own and control the corporations. They’ve long since bought and paid for the senate, the congress, the state houses, the city halls, they got the judges in their back pockets and they own all the big media companies so they control just about all of the news and information you get to hear. They got you by the balls. They spend billions of dollars every year lobbying, lobbying, to get what they want. Well, we know what they want. They want more for themselves and less for everybody else, but I'll tell you what they don’t want: They don’t want a population of citizens capable of critical thinking. They don’t want well informed, well educated people capable of critical thinking. They’re not interested in that. That doesn’t help them. Thats against their interests. Thats right. They don’t want people who are smart enough to sit around a kitchen table to figure out how badly they’re getting f*cked by a system that threw them overboard 30 f*cking years ago. They don’t want that. You know what they want? They want obedient workers. Obedient workers. People who are just smart enough to run the machines and do the paperwork, and just dumb enough to passively accept all these increasingly shittier jobs with the lower pay, the longer hours, the reduced benefits, the end of overtime and the vanishing pension that disappears the minute you go to collect it, and now they’re coming for your Social Security money. They want your retirement money. They want it back so they can give it to their criminal friends on Wall Street, and you know something? They’ll get it. They’ll get it all from you, sooner or later, 'cause they own this f*cking place. It's a big club, and you ain’t in it. You and I are not in the big club. And by the way, it's the same big club they use to beat you over the head with all day long when they tell you what to believe. All day long beating you over the head in their media telling you what to believe, what to think and what to buy. The table is tilted folks. The game is rigged, and nobody seems to notice, nobody seems to care. Good honest hard-working people -- white collar, blue collar, it doesn’t matter what color shirt you have on -- good honest hard-working people continue -- these are people of modest means -- continue to elect these rich c*cksuckers who don’t give a f*ck about them. They don’t give a f*ck about you. They don’t give a f*ck about you. They don't care about you at all -- at all -- at all. And nobody seems to notice, nobody seems to care. That's what the owners count on; the fact that Americans will probably remain willfully ignorant of the big red, white and blue dick that's being jammed up their assholes everyday. Because the owners of this country know the truth: it's called the American Dream, because you have to be asleep to believe it.
mkey je offline   Reply With Quote
Staro 07.05.2024., 21:21   #3212
strikoo
Premium
 
strikoo's Avatar
 
Datum registracije: Nov 2004
Lokacija: HR
Postovi: 751
pa dignes doker
strikoo je offline   Reply With Quote
Staro 07.05.2024., 21:40   #3213
tomek@vz
Premium
Moj komp
 
tomek@vz's Avatar
 
Datum registracije: May 2006
Lokacija: München/Varaždin
Postovi: 3,373
Citiraj:
Autor mkey Pregled postova
Ma stvar je u tome što svako toliko imam potrebu za pripremiti neki environment. Kao npr relativno nedavno gap engine sa python2 gdje sam hrpetinu paketa ručno instalirao da to osposobim. Volio bit takve stvari imati u nekakvom containeru tako da kada instaliram hrpu sranja da to bude odvojeno od operativnog.

Pa sam tako gledao neke distribucije koje dolaze sa distrobox i varijantama istog. Samo što takve kombinacije nisu standard i to održava neki lik koji ima 17 godina pa napravi kad stigne. Nije baš neki standard.
Hallloooooooo....Ansible Uz to upogonis KVM virtualke i/ili docker/podman i sta ce ti vise? Vagrant isto nije bedasto rijesenje.

https://www.youtube.com/results?sear...+setup+ansible

Evo ti par malo detaljnijh videa za pocetak:


https://www.youtube.com/watch?v=3RiVKs8GHYQ&list=PLT98CRl2KxKEUHie1m24-wkyHpEsa4Y70
https://www.youtube.com/watch?v=SXwC9fSwct8

Zadnje izmijenjeno od: tomek@vz. 07.05.2024. u 22:03.
tomek@vz je online   Reply With Quote
Staro Jučer, 19:10   #3214
mkey
Premium
Moj komp
 
Datum registracije: Sep 2018
Lokacija: tu
Postovi: 1,961
E jebemu, već si mi spominjao ansible Morati ću ovaj puta i ispratiti.
__________________
Citiraj:
Autor George Carlin
But there’s a reason. There’s a reason. There’s a reason for this, there’s a reason education sucks, and it’s the same reason that it will never, ever, ever be fixed. It’s never gonna get any better. Don’t look for it. Be happy with what you got. Because the owners of this country don't want that. I'm talking about the real owners now, the real owners, the big wealthy business interests that control things and make all the important decisions. Forget the politicians. The politicians are put there to give you the idea that you have freedom of choice. You don't. You have no choice. You have owners. They own you. They own everything. They own all the important land. They own and control the corporations. They’ve long since bought and paid for the senate, the congress, the state houses, the city halls, they got the judges in their back pockets and they own all the big media companies so they control just about all of the news and information you get to hear. They got you by the balls. They spend billions of dollars every year lobbying, lobbying, to get what they want. Well, we know what they want. They want more for themselves and less for everybody else, but I'll tell you what they don’t want: They don’t want a population of citizens capable of critical thinking. They don’t want well informed, well educated people capable of critical thinking. They’re not interested in that. That doesn’t help them. Thats against their interests. Thats right. They don’t want people who are smart enough to sit around a kitchen table to figure out how badly they’re getting f*cked by a system that threw them overboard 30 f*cking years ago. They don’t want that. You know what they want? They want obedient workers. Obedient workers. People who are just smart enough to run the machines and do the paperwork, and just dumb enough to passively accept all these increasingly shittier jobs with the lower pay, the longer hours, the reduced benefits, the end of overtime and the vanishing pension that disappears the minute you go to collect it, and now they’re coming for your Social Security money. They want your retirement money. They want it back so they can give it to their criminal friends on Wall Street, and you know something? They’ll get it. They’ll get it all from you, sooner or later, 'cause they own this f*cking place. It's a big club, and you ain’t in it. You and I are not in the big club. And by the way, it's the same big club they use to beat you over the head with all day long when they tell you what to believe. All day long beating you over the head in their media telling you what to believe, what to think and what to buy. The table is tilted folks. The game is rigged, and nobody seems to notice, nobody seems to care. Good honest hard-working people -- white collar, blue collar, it doesn’t matter what color shirt you have on -- good honest hard-working people continue -- these are people of modest means -- continue to elect these rich c*cksuckers who don’t give a f*ck about them. They don’t give a f*ck about you. They don’t give a f*ck about you. They don't care about you at all -- at all -- at all. And nobody seems to notice, nobody seems to care. That's what the owners count on; the fact that Americans will probably remain willfully ignorant of the big red, white and blue dick that's being jammed up their assholes everyday. Because the owners of this country know the truth: it's called the American Dream, because you have to be asleep to believe it.
mkey je offline   Reply With Quote
Staro Danas, 06:59   #3215
tux-scooby
Premium
Moj komp
 
tux-scooby's Avatar
 
Datum registracije: Jan 2009
Lokacija: Donji Miholjac-Osijek
Postovi: 279
Ansible, puppet, chef...ali da,ansible se tu pokazao kao pravi pogodak.

Sent from my SM-G991B using Tapatalk
tux-scooby je offline   Reply With Quote
Staro Danas, 08:21   #3216
Ivo_Strojnica
PRO
Moj komp
 
Ivo_Strojnica's Avatar
 
Datum registracije: Apr 2010
Lokacija: Zagreb
Postovi: 4,191
Citiraj:
Autor mkey Pregled postova
E jebemu, već si mi spominjao ansible Morati ću ovaj puta i ispratiti.
Hjao, Ansible je bog konfiguracije, nemoj se ni šaliti, odmah to riješi za olakšati si život.
__________________
"Who is your daddy and what does he do?"
Ivo_Strojnica je offline   Reply With Quote
Staro Danas, 08:32   #3217
tux-scooby
Premium
Moj komp
 
tux-scooby's Avatar
 
Datum registracije: Jan 2009
Lokacija: Donji Miholjac-Osijek
Postovi: 279
Ovisno o potrebi, nije los ni cloud-init ni kickstart pristup.
tux-scooby je offline   Reply With Quote
Staro Danas, 08:43   #3218
tomek@vz
Premium
Moj komp
 
tomek@vz's Avatar
 
Datum registracije: May 2006
Lokacija: München/Varaždin
Postovi: 3,373
U tome i je poanta - postoje alternative ali za razliku od Ansible pristupa zahtjevaju vise pripreme i ucenja. A ako samo trebas pripremu OS-a bez da manualno sve uvijek isponova radis - Ansible je vrlo jednostavan i mocan alat. Ne moras za pocetak ni komlicirat si zivot za naprednim stavkama. Kreiraj svoj ansible.cfg, svoj inventory fajl i lupi sve taskove u jedan playbook - dovoljno da za pocetak skuzis sko kako funkcionira a baznoj razini. Kasnije vec mozes modularizirat sve skupa za vise primjena, OS-eva itd.


Evo ti jednostavan primjer:


ansible.cfg

Code:
[defaults]
ansible_port = 22
remote_user = tomek
inventory = ./inventory
roles_path = roles/
gathering = smart
fact_caching = jsonfile
fact_caching_connection = ./facts
fact_caching_timeout = 600
log_path = ./ansible.log
remote_tmp = /tmp
# work around privilege escalation timeouts in ansible:
timeout = 30

[inventory]
# fail more helpfully when the inventory file does not parse (Ansible 2.4+)
unparsed_is_failed=true

[ssh_connection]
pipelining = True
ssh_args = -o ControlMaster=auto -o ControlPersist=600s
# shorten the ControlPath which is often too long; when it is,
# ssh connection reuse silently fails, making everything slower.
control_path = %(directory)s/%%h-%%r

[privilege_escalation]
become = yes
become_user = root
become_method = sudo
inventory fajl:
Citiraj:
[host]
192.168.1.103 ansible_python_interpreter=/usr/bin/python3
#localhost ansible_connection=local ansible_python_interpreter=/usr/bin/python3
Jedine predispozicije za remote izvedbu su ti:
- korisnik sa sudo NOPASSWD konfiguracijom na remote kanti
- prijava sa tim korisnikom preko ssh kljuca


Ansible skripte naravno mozes i lokalno izvoditi na stroju/virtualki samo onda zakomentiras u inventory prvu liniju o odkomentiras drugu. Plus u main.yaml na pocetku dodas ove dvije stavke:


Citiraj:
- hosts: 127.0.0.1
connection: local
Evo ti primjer jednog jednostavnog yaml playbooka za baznu konfiguraciju vise OS-eva:




Code:
---
#----------------------------------------------------------------------------------------
#   version         1.0
#   author          
#   copyright       
#   email           
#   license         Apache 2
########################################################
# 1.0 stable release
#---------------------------------------------------------------------------------------

  - hosts: all
    become: yes
    vars:
      net_iface: eth0
      linux_user: tomek
    
    tasks:

      - name: Modify Grub timeout
        lineinfile:
          path: /etc/default/grub
          regexp: '^GRUB_TIMEOUT='
          line: 'GRUB_TIMEOUT=1'

      - name: Do App stuff
        include_tasks: tasks/Debian/apps.yaml
        when: ansible_distribution == 'Debian'

      - name: Install Virtualization stuff
        include_tasks: tasks/Debian/qemu.yaml
        when: ansible_distribution == 'Debian'

      - name: Harden Security
        include_tasks: tasks/Debian/security.yaml
        when: ansible_distribution == 'Debian'
        
      - name: Do App stuff
        include_tasks: tasks/RedHat/apps.yaml
        when: ansible_distribution == 'RedHat'

      - name: Install Virtualization stuff
        include_tasks: tasks/RedHat/qemu.yaml
        when: ansible_distribution == 'RedHat'

      - name: Setup Samba Share
        include_tasks: tasks/RedHat/samba.yaml
        when: ansible_distribution == 'RedHat'
        
      - name: Harden Security
        include_tasks: tasks/RedHat/security.yaml
        when: ansible_distribution == 'RedHat'
        
      - name: Install Virtualization stuff
        include_tasks: tasks/SuSe/qemu.yaml
        when: ansible_distribution == 'openSUSE Leap'

      - name: Setup Samba Share
        include_tasks: tasks/SuSe/samba.yaml
        when: ansible_distribution == 'openSUSE Leap'
        
      - name: Harden Security
        include_tasks: tasks/SuSe/security.yaml
        when: ansible_distribution == 'openSUSE Leap'

      - name: Sync config to skel profile
        synchronize:
          src: files/skel/
          dest: /etc/skel/
          delete: yes
          recursive: yes

      - name: get fresh git prompt
        command: git clone https://github.com/magicmonty/bash-git-prompt.git /etc/skel/.bash-git-prompt --depth=1
           
      - name: Enable NTP Daemon
        systemd:
          service: chronyd
          state: started
           enabled: yes
Ovo je recimo Debianov apps task:


Code:
---
#----------------------------------------------------------------------------------------
#   version         1.0
#   author          
#   copyright       
#   email           
#   license         Apache 2
#######################################################
# 1.0 stable release
#---------------------------------------------------------------------------------------
  - name: Setup repos
    blockinfile:
      path: /etc/apt/sources.list
      block: |
        deb http://ftp.de.debian.org/debian bookworm main contrib non-free non-free-firmware
        deb-src http://ftp.de.debian.org/debian bookworm main contrib non-free non-free-firmware
        deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
        deb-src http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware

  - name: Update OS
    apt:
      name: '*'
      state: latest
      update_cache: yes

  - name: Remove apps
    apt:
      name:
        - nano
      state: absent
      autoremove: yes
      autoclean: yes

  - name: Install base apps
    apt:
      name:
        - acpid
        - apt-show-versions
        - apt-xapian-index
        - cifs-utils
        - chrony
        - debian-goodies
        - debsecan
        - debsums
        - dkms               
        - apt-utils          
        - firmware-linux
        - firmware-linux-nonfree
        - firmware-misc-nonfree
        - firmware-realtek
        - git
        - htop    
        - libpam-tmpdir
        - libpam-pwquality
        - python3-cracklib
        - lm-sensors  
        - needrestart       
        - openssl            
        - perl               
        - rsync       
        - smartmontools
        - tlp      
        - tmux
        - vim       
      state: present
A ovako izgleda tree:





Ja sam si taskove za pojedine OS-eve na ovaj nacin odvojio jer mi lakse azurirat sve skupa no kao sto rekoh pogotovo u startu - ne moras. Jedino kad prckas po yaml fajlovima pazi na space i moja preporuka ti je u editoru koji koristis prebacit tab u 4x space. Ak te kaj zanima - pitaj.

Zadnje izmijenjeno od: tomek@vz. Danas u 08:54.
tomek@vz je online   Reply With Quote
Staro Danas, 08:47   #3219
tomek@vz
Premium
Moj komp
 
tomek@vz's Avatar
 
Datum registracije: May 2006
Lokacija: München/Varaždin
Postovi: 3,373
Citiraj:
Autor tux-scooby Pregled postova
Ovisno o potrebi, nije los ni cloud-init ni kickstart pristup.

Dobri su ali kao i autoyast - jako limitirani i namijenjeni prije svega samo za baznu konfiguraciju servera kod instalacije. Ansible je puno fleksibilniji i mocniji pogotovo za naprednije konfiguracije.
tomek@vz je online   Reply With Quote
Staro Danas, 09:18   #3220
tux-scooby
Premium
Moj komp
 
tux-scooby's Avatar
 
Datum registracije: Jan 2009
Lokacija: Donji Miholjac-Osijek
Postovi: 279
Nekada više o bazne konfiguracije servera ni ne moras raditi ali da, ansible tu sve gazi. Pogotovo mi veliku prednost imaju collection-i za tipa ovirt i vmware pa se može svašta nešto automatizirati.
tux-scooby je offline   Reply With Quote
Odgovori



Pravila postanja
Vi ne možete otvarati nove teme
Vi ne možete pisati odgovore
Vi ne možete uploadati priloge
Vi ne možete uređivati svoje poruke

BB code je Uključeno
Smajlići su Uključeno
[IMG] kod je Uključeno
HTML je Isključeno

Idi na