Skip to content

Latest commit

 

History

History

0_ansible

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Ansible

# ansible-inventory -i hosts.ini --list -y
> ansible-inventory --inventory hosts.ini --list --yaml
all:
  children:
    home:
      hosts:
        local:
          ansible_connection: local
    ungrouped: {}
# ansible all -i hosts.ini -m ping
ansible all --inventory hosts.ini --module-name ping -vvv

# on MacOSX
local | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/opt/homebrew/bin/python3.10"
    },
    "changed": false,
    "ping": "pong"
}

# on Ubuntu
local | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python3"
    },
    "changed": false,
    "ping": "pong"
}
ansible all --inventory hosts.ini --args "df -h" -vvv

참조