-
Notifications
You must be signed in to change notification settings - Fork 2
command
jasper-zanjani edited this page Aug 23, 2020
·
2 revisions
Safest module to execute remote commands on client machine, requires Python. When Ansible execute commands using the Command module, they are not processed through the user's shell (meaning environment variables like $HOME
and output redirection are not available).
Takes command name followed by a list of space-delimited arguments. opensource.com
ansible all -i inventory -m command -a 'cat /etc/motd' -u ansible
- name: return motd to registered var
command: cat /etc/motd
register: mymotd
- name: Change the working directory to somedir/ and run the command as db_owner if /path/to/database does not exist.
command: /usr/bin/make_database.sh db_user db_name
become: yes
become_user: db_owner
args:
chdir: somedir/
creates: /path/to/database
ansible
ansible-doc
ansible-galaxy
ansible-inventory
ansible-playbook
- apt ?
- archive ?
- cli_config ?
- command ?
- copy ?
- debug ?
- dnf ?
- file ?
- git ?
- lineinfile ?
- package ?
- ping ?
- raw ?
- service ?
- setup ?
- shell ?
- template?
- Ad hoc command
- Ansible Galaxy
- Ansible Tower
- Ansible Vault
- AWX
- Configuration files
- EPEL
- Fact
- Handler
- Inventory
- Module
- Module Library
- Play
- Playbook
- Role
- Task
- Vault