From 253618c152b21a5bfaab97110fd3c4fcab5dfdaa Mon Sep 17 00:00:00 2001 From: Gregory Ballantine Date: Thu, 2 Apr 2026 12:28:20 -0400 Subject: [PATCH] Initial ansible structure and test code --- .gitignore | 3 +++ ansible.cfg | 14 ++++++++++++++ inventories/hosts.ini | 12 ++++++++++++ playbooks/ping.yml | 6 ++++++ requirements.yml | 3 +++ 5 files changed, 38 insertions(+) create mode 100644 .gitignore create mode 100644 ansible.cfg create mode 100644 inventories/hosts.ini create mode 100644 playbooks/ping.yml create mode 100644 requirements.yml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7d75431 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# ignore installed roles/collections +collections/ +roles/ diff --git a/ansible.cfg b/ansible.cfg new file mode 100644 index 0000000..15c3966 --- /dev/null +++ b/ansible.cfg @@ -0,0 +1,14 @@ +[defaults] + +inventory = ./inventories/hosts.ini +roles_path = ./roles +collections_paths = ./collections +host_key_checking = False +retry_files_enabled = False +timeout = 30 +forks = 10 + +[privilege_escalation] +become = True +become_method = sudo +#become_ask_pass = False diff --git a/inventories/hosts.ini b/inventories/hosts.ini new file mode 100644 index 0000000..5225ead --- /dev/null +++ b/inventories/hosts.ini @@ -0,0 +1,12 @@ +[control] +mustafar ansible_host=mustafar + +[web] +lb-v3 ansible_host=lb-v3.int.metaunix.net +ks-v2 ansible_host=ks-v2.int.metaunix.net + +[nameservers] +#ns1 ansible_host=ns1.int.metaunix.net +#ns2 ansible_host=ns2.int.metaunix.net +ns3 ansible_host=ns3.int.metaunix.net +ns4 ansible_host=ns4.int.metaunix.net diff --git a/playbooks/ping.yml b/playbooks/ping.yml new file mode 100644 index 0000000..29b1179 --- /dev/null +++ b/playbooks/ping.yml @@ -0,0 +1,6 @@ +- name: Test connectivity + hosts: all + + tasks: + - name: Ping hosts + ansible.builtin.ping: diff --git a/requirements.yml b/requirements.yml new file mode 100644 index 0000000..73966e9 --- /dev/null +++ b/requirements.yml @@ -0,0 +1,3 @@ +collections: + - name: ansible.posix + - name: community.general