ansible.yml
- Read more about ansible.yml
- Log in to post comments
cat < /etc/ansible/test.yml
---
- hosts: all
tasks:
- debug: msg="{{ ansible_user_id }}@{{ inventory_hostname }}"
EOF
---
- hosts:
srv.example.com
remote_user: ubuntu
become: yes
tasks:
- name: Update all packages
apt:
update_cache: yes
upgrade: dist
- name: Show command output
command: id
register: out
- debug: var=out.stdout_lines
- name: print to stdout
command: id
register: print
- debug: msg="{{ print.stdout }}"
- debug: msg="{{ print.stderr }}"
- hosts: all
# p