Changes

Jump to: navigation, search

Ops535 ansible lab

134 bytes added, 00:53, 29 January 2021
Part 2: Sample runs for some of the Ad hoc commands
== Part 2: Sample runs for some of the Ad hoc commands ==
<pre>
[rchan@centos7 ansiblehost ~]$ ansible 192.168.9949.153 3 -m copy -a "src=/home/rchan/ops435ops535/ansible/ansible.txt dest=/tmp/ansible.txt"192.168.9949.153 3 | SUCCESS CHANGED => { "ansible_facts": { "discovered_interpreter_python": "/usr/libexec/platform-python" }, "changed": true, "checksum": "837affc90674fb92cdb0ebac6e49ad31a586b37e82548876259158d4ba80a56ff311664353e49271", "dest": "/tmp/ansible.txt", "gid": 10011000, "group": "rchan", "md5sum": "78ae49d77d28d06173cf2194a39097320bcc4d27cff6cd55138dd615a09669ab", "mode": "0664", "owner": "rchan", "secontext": "unconfined_u:object_r:user_home_t:s0", "size": 106132, "src": "/home/rchan/.ansible/tmp/ansible-tmp-15429021191611895800.159722285-30336-117618539513309117758560038295/source", "state": "file", "uid": 10011000
}
</pre>
: 192.168.9949.153 3 is the remote machine's IP address.: "-m copy" tells ansible to use the copy module(type ansible-doc copy for module documentation)
: after '-a' is the arguments to the copy module, which specify the source file and the destination for the copy action.
: If you got the same "SUCCESSCHANGED" status message, login to the remote machine (in this example, it is 192.168.9949.1533) and check the directory "/tmp" for the file ansible.txt.
== Part 3: Sample runs for using some Ansible's built-in modules ==
1,760
edits

Navigation menu