Changes

Jump to: navigation, search

Ops535 ansible lab

128 bytes added, 23:59, 28 January 2021
Part 3: Sample runs for using some Ansible's built-in modules
ansible-doc module_name
e.g. ansible_doc copy
e.g. ansible_doc yum
</source>
: The following command demonstrates how to install the "epel-releasebind" package with the "yum" moduleand the response message under different conditions:
<pre>
[rchan@centos7 ansiblehost ~]$ ansible 192.168.9949.153 3 -m yum dnf -a "name=epel-release bind state=present"-b192.168.9949.153 3 | SUCCESS CHANGED => { "ansible_facts": { "discovered_interpreter_python": "/usr/libexec/platform-python" }, "changed": falsetrue, "msg": "", "rc": 0,
"results": [
"epel-release-7Installed: bind-32:9.11.noarch providing epel20-release is already installed5.el8.x86_64"
]
}
 [rchan@centos7 ansiblehost ~]$ ansible 192.168.9949.153 3 -m yum dnf -a "name=epel-release bind state=present" -u rootb192.168.9949.153 3 | SUCCESS => { "ansible_facts": { "discovered_interpreter_python": "/usr/libexec/platform-python" }, "changed": false, "msg": "Nothing to do", "rc": 0, "results": [ "epel-release-7-11.noarch providing epel-release is already installed" ]
}
 [rchan@centos7 ansiblehost ~]$ ansible 192.168.9949.153 3 -m yum dnf -a "name=epel-release bind state=latest" -u rootb192.168.9949.153 3 | SUCCESS => { "ansible_facts": { "discovered_interpreter_python": "/usr/libexec/platform-python" }, "changed": false, "msg": "Nothing to do", "rc": 0, "results": [ "All packages providing epel-release are up to date", "" ]
}
</pre>
1,760
edits

Navigation menu