Set up the hostname of ansible server to ansible.localdomain Install the ansible package yum install ansible Add servers (master,infra,worker) to /etc hosts. [root@ansible ~]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.217.10 master 192.168.217.11 infra 192.168.217.12 worker1 Set up ansible.conf, uncomment the privilege_escalation parameters. [privilege_escalation] become=True become_method=sudo become_user=root become_ask_pass=False Create …
Tag: ansible
dec 28
Ansible and sed
How to use sed command with ansible: [<user>@ansible ansible]# ansible -i hosts <group> -m shell -a „sed -i s/fromstring/tostring/ <file>” If do you have special chars, use the \ before these chars. For example: „sed -i s/formsting/stostringwith\|pipe/ <file>”




