KB: Ansible CLI common
Ansible common /useful commands:
ansible --version
to change default python version and other config values you need to edit /etc/ansible/ansible.cfg
Ansible host list: /etc/ansible/hosts
ansible <host_name> -m ping -u '<username>' --ask-pass -b -become-user=root -K
# nearly all parameters can be overridden in ansible-playbook
# or with command line flags. ansible will read ANSIBLE_CONFIG,
# ansible.cfg in the current working directory, .ansible.cfg in
# the home directory or /etc/ansible/ansible.cfg, whichever it
# finds first
Comments
Post a Comment