User Tools

Site Tools


tips:ansible

**This is an old revision of the document!**

Table of Contents

ansible

basic op

ansible all --list-hosts
 
ansible all -m ping

playbook

helloworld.yaml
- name: helloworld
  hosts: nodes
  tasks:
   - name: Ping my hosts
     ansible.builtin.ping:
   - name: Print message
     ansible.builtin.debug:
       msg: Hello world
ansible-playbook helloworld.yaml

install

python3 -m pip install --user ansible

config

/etc/ansible/hosts
[nodes]
10.45.0.1
10.45.0.2
10.45.0.3
10.45.0.4
10.45.0.5
tips/ansible.1662709942.txt.gz · Last modified: by sscipioni