https://www.tutorialspoint.com/ansible/ansible_environment_setup.htm
sudo apt-get update
sudo apt-get install software-properties-common
sudo apt-add-repository ppa:ansible/ansible
sudo apt-get update
sudo apt-get install ansible
ansible --version
echo ansible 2.10.15
https://tdhopper.com/blog/automating-python-with-ansible
ansible -i 'localhost,' -c local -m ping all
localhost | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python3"
},
"changed": false,
"ping": "pong"
}
ansible all -i 'localhost, ' -c local -a "/bin/echo hello"
localhost | CHANGED | rc=0 >>
hello
TBC
沒有留言:
張貼留言