add test play, add .gitignore, update ansible.cfg, update hosts

This commit is contained in:
Chris Hammer 2023-03-13 11:41:45 -04:00
parent 2d97fbda12
commit c0ee091d15
4 changed files with 38 additions and 3 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
collections
facts.d

View File

@ -1,7 +1,7 @@
[defaults]
inventory = hosts
roles_path = roles
collections_path = collections
collections_path = /etc/ansible/collections
remote_tmp = /tmp/.ansible-${USER}/tmp
gathering = smart
gather_timeout = 300
@ -15,7 +15,7 @@ timeout = 30
host_key_checking = False
display_skipped_hosts = False
bin_ansible_callbacks = True
callback_whitelist = ansible.posix.profile_tasks, ansible.posix.timer
callbacks_enabled = ansible.posix.profile_tasks, ansible.posix.timer
deprecation_warnings = False
command_warnings = False
#strategy = free

6
hosts
View File

@ -17,6 +17,10 @@ lab-dev-15 ansible_host=10.10.42.177
lab-dev-16 ansible_host=10.10.42.133
lab-dev-17 ansible_host=10.10.42.179
lab-dev-18 ansible_host=10.10.42.165
lab-dev-19 ansible_host=10.10.42.188
lab-dev-19 ansible_host=10.10.42.188 ansible_user=broken
lab-dev-20 ansible_host=10.10.42.142
[dev:vars]
ansible_user=root

29
test.yml Normal file
View File

@ -0,0 +1,29 @@
---
- name: Perform some tests
hosts: all
become: no
gather_facts: no
tasks:
- name: Do a debug thing
debug:
msg: "Hello world!"
- name: Run a command
command:
cmd: uptime
register: r_cmd_1
- name: Clear errors if any
meta: clear_host_errors
- name: Show command output
debug:
msg: "{{ r_cmd_1.stdout | default('plop plop plop') }}"
...