host.txt
1 2 3 4 5 6 |
ansible all -m setup - выведет параметры всех серверов ansible staging_servers -m setup - выведет параметры группы taging_servers [staging_servers] linux1 ansible_host=192.168.15.142 owner=LOL |
playbook_debug.yml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
--- - name: My super Playbook hosts: all become: yes vars: message1: privet message2: word secret : LKKDKDKDKDLSDKLSKD tasks: - name: Print Sectret variable debug: var: secret - debug: msg: "Sekretnoe slovo {{ secret }}" - debug: msg: "Vladelec etogo servera --> {{ owner }} <--" - set_fact: full_message=" {{ message1 }} {{ message2 }} from {{ owner }}" - debug: var: full_message - debug: var: ansible_distribution - debug: var: ansible_all_ipv4_addresses - shell: uptime register: results - debug: var: results - debug: var: results.stdout ... |