Difference between revisions of "Examples of Ansible execution modules"
Jump to navigation
Jump to search
(→Errors) |
|||
Line 9: | Line 9: | ||
== Errors == | == Errors == | ||
ansible -m shell [[yourhost]] -a uptime | ansible -m shell [[yourhost]] -a uptime | ||
− | [WARNING]: No inventory was parsed, only implicit localhost is available | + | [WARNING]: [[No inventory was parsed, only implicit localhost is available]] |
− | [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit | + | [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all' |
− | + | [WARNING]: [[Could not match supplied host pattern, ignoring]]: yourhost | |
− | [WARNING]: Could not match supplied host pattern, ignoring: yourhost | ||
== Example == | == Example == |
Latest revision as of 13:27, 18 April 2023
ansible -m raw DESTINATION_HOSTNAME -a uptime
ansible -m shell DESTINATION_HOSTNAME -a uptime
ansible -m command DESTINATION_HOSTNAME -a uptime
(Do not support some characters as: "|")
ansible -m raw DESTINATION_HOSTNAME -a "df -kh | grep YOUR_STRING"
Contents
Errors[edit]
ansible -m shell yourhost -a uptime [WARNING]: No inventory was parsed, only implicit localhost is available [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all' [WARNING]: Could not match supplied host pattern, ignoring: yourhost
Example[edit]
ansible -m raw --ask-pass --ask-become-pass DESTINATION_HOSTNAME -a uptime
ansible -m raw -u MY_USERNAME -k -K DESTINATION_HOSTNAME -a uptime
Related terms[edit]
See also[edit]
- Ansible: modules, plugins, Playbooks (examples)
ansible-playbook
,ansible-vault
,ansible-inventory
,ansible-config
, Ansible Tower, Ansible Galaxy (Roles) (ansible-galaxy
),ansible-cmdb
,gather facts
,ansible.cfg
,Ansible Molecule
, Ansible collections,register
,template
,--ask-pass
,--ask-become-pass
,remote_user:
,/etc/ansible/hosts
,ansible-doc
,ansible-lint
,.ansible/
,--forks
,--start-at-task
,changelog
,inventory
,Notify:
,ansible HOSTNAME -m ping
,gathering
,/usr/bin/ansible
,ansible -m ping
,ansible.builtin
,hosts: (Ansible)
,set fact:
,when:
,blockinfile:
,become method:
,include:
,git:
, AWX,ansible --help
, Tags, Ansible variables, versions
Advertising: