Changes between Version 16 and Version 17 of Csle2022/Agenda/Ansible
- Timestamp:
- Nov 19, 2022, 4:23:36 AM (2 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Csle2022/Agenda/Ansible
v16 v17 161 161 '''Add the managed nodes to control node Ansible hosts file''' 162 162 163 Login as root to the control node. 164 {{{ 165 nano /etc/ansible/hosts 166 }}} 167 168 Insert the following with the required changes according to your setting. 169 {{{ 170 [Dbservers] 171 172 db1 ansible_ssh_user=docker ansible_ssh_host=<first managed node IP address> 173 174 db2 ansible_ssh_user=docker ansible_ssh_host=<second managed node IP address> 175 }}} 176 177 178 {{{ 163 Login to the control node. 164 {{{ 165 nano inventory 166 }}} 167 168 Insert the managed nodes' internal network IP addresses to the file according to your setting. And save it. 169 {{{ 170 10.1.1.2 171 10.1.1.3 172 }}} 173 179 174 Verify connectivity 180 }}} 181 182 {{{ 183 ansible -m ping Dbservers 175 176 {{{ 177 ansible all -i inventory -m ping 178 }}} 179 180 Output should be similar to the following. 181 182 183 {{{ 184 10.1.1.2 | SUCCESS => { 185 "ansible_facts": { 186 "discovered_interpreter_python": "/usr/bin/python3" 187 }, 188 "changed": false, 189 "ping": "pong" 190 } 191 10.1.1.3 | SUCCESS => { 192 "ansible_facts": { 193 "discovered_interpreter_python": "/usr/bin/python3" 194 }, 195 "changed": false, 196 "ping": "pong" 197 } 184 198 }}} 185 199