Monthly Archives: August 2018

ansible install on raspberry pi

apt-get install software-properties-common apt-get update apt-get install ansible now change the hosts file in /etc/ansible make sure you have publickey login on the hosts e.g. run: ssh-copy-id root@host1 then check with ansible: ansible -m ping all some adhoc examples: list … Continue reading

Posted in Uncategorized | Leave a comment

ansible play-book create a user

– hosts: linvms user: root vars: #password is ‘yourpass’ password: $1$xyz$X5pC0RUqKE5mOgXcDDgFk0 tasks: – user: name=peter password={{password}}

Posted in Uncategorized | Leave a comment

ansible ad-hoc

$ ansible atlanta -m copy -a “src=/etc/hosts dest=/tmp/hosts” $ ansible webservers -m file -a “dest=/srv/foo/a.txt mode=600” $ ansible webservers -m file -a “dest=/srv/foo/b.txt mode=600 owner=linuser group=linuser” $ ansible webservers -m file -a “dest=/path/to/c mode=755 owner=linuser group=linuser state=directory” $ ansible webservers … Continue reading

Posted in Uncategorized | Leave a comment

ansible-playbook example

$ cat p1.yml — – hosts: linvms vars: http_port: 80 max_clients: 200 remote_user: root tasks: – name: ensure apache is at the latest version yum: name: httpd state: latest – name: write the apache config file template: src: /etc/httpd/conf/httpd.conf dest: … Continue reading

Posted in Uncategorized | Leave a comment

centos vlan setup

# cat ifcfg-ens224 TYPE=Ethernet BOOTPROTO=none NAME=ens224 UUID=60edd252-25eb-4396-baca-f7b09a3bec5e DEVICE=ens224 ONBOOT=yes # cat ifcfg-ens224.2 TYPE=Vlan BOOTPROTO=none NAME=ens224.2 UUID=60edd252-25eb-4396-baca-f7b09a3bec5e DEVICE=ens224.2 IPADDR=192.168.2.11 PREFIX=24 ONBOOT=yes VLAN=yes

Posted in Uncategorized | Leave a comment