Changes between Version 16 and Version 17 of Csle2022/Agenda/Ansible


Ignore:
Timestamp:
Nov 19, 2022, 4:23:36 AM (2 years ago)
Author:
dushmantha
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Csle2022/Agenda/Ansible

    v16 v17  
    161161'''Add the managed nodes to control node Ansible hosts file'''
    162162
    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 {{{
     163Login to the control node.
     164{{{
     165nano inventory
     166}}}
     167
     168Insert the managed nodes' internal network IP addresses to the file according to your setting. And save it.
     169{{{
     17010.1.1.2
     17110.1.1.3
     172}}}
     173
    179174Verify connectivity
    180 }}}
    181  
    182 {{{
    183 ansible -m ping Dbservers
     175
     176{{{
     177ansible all -i inventory -m ping
     178}}}
     179
     180Output should be similar to the following.
     181
     182
     183{{{
     18410.1.1.2 | SUCCESS => {
     185    "ansible_facts": {
     186        "discovered_interpreter_python": "/usr/bin/python3"
     187    },
     188    "changed": false,
     189    "ping": "pong"
     190}
     19110.1.1.3 | SUCCESS => {
     192    "ansible_facts": {
     193        "discovered_interpreter_python": "/usr/bin/python3"
     194    },
     195    "changed": false,
     196    "ping": "pong"
     197}
    184198}}}
    185199