Linux technical support - [email protected]


ansible

ansible-playbook test.yml -u root --check --diff --limit my-server.lan

$ cat test.yml 
- hosts: local
  tasks:
  - name: Ansible copy file to remote server
    copy:
      src: /home/agorbachev/git/agorbachev001/alex.txt
      dest: /tmp/alex.txt

# EXEC COMMAND
ansible all -s -u root -m shell -a 'ls -la'

ansible all -m command -a 'ls'

# APPLY PLAYBOOK WITHOUT INVENTORY
ansible-playbook -u root  --diff -i my-host.test.lan, add_user.yml

# ADD USER TO ALL HOSTS
ansible-playbook users/admins.yml --tags "alex"

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>