From 3e9a5857d42ee9c4ebaee34d0bbb5d2ce1c12f01 Mon Sep 17 00:00:00 2001 From: Michael Balsillie Date: Wed, 19 Aug 2026 14:16:39 -0400 Subject: [PATCH] Become connection working --- .../ch01.balsillie.house/ansible_become.yml | 3 +++ .../ch01.balsillie.house/ansible_connection.yml | 4 ++++ inventory/inventory.yml | 5 +++++ playbooks/container-host.yml | 12 ++++++++++++ 4 files changed, 24 insertions(+) create mode 100644 inventory/host_vars/ch01.balsillie.house/ansible_become.yml create mode 100644 inventory/host_vars/ch01.balsillie.house/ansible_connection.yml create mode 100644 inventory/inventory.yml create mode 100644 playbooks/container-host.yml diff --git a/inventory/host_vars/ch01.balsillie.house/ansible_become.yml b/inventory/host_vars/ch01.balsillie.house/ansible_become.yml new file mode 100644 index 0000000..75fbfde --- /dev/null +++ b/inventory/host_vars/ch01.balsillie.house/ansible_become.yml @@ -0,0 +1,3 @@ +ansible_become_method: ansible.builtin.sudo +ansible_sudo_user: root +ansible_sudo_pass: "{{ lookup('community.general.passwordstore', 'ansible/become-password') }}" diff --git a/inventory/host_vars/ch01.balsillie.house/ansible_connection.yml b/inventory/host_vars/ch01.balsillie.house/ansible_connection.yml new file mode 100644 index 0000000..be7fea2 --- /dev/null +++ b/inventory/host_vars/ch01.balsillie.house/ansible_connection.yml @@ -0,0 +1,4 @@ +ansible_connection: ansible.builtin.ssh +ansible_ssh_host: ch01.balsillie.house +ansible_ssh_port: 22 +ansible_ssh_user: ladmin diff --git a/inventory/inventory.yml b/inventory/inventory.yml new file mode 100644 index 0000000..3d18591 --- /dev/null +++ b/inventory/inventory.yml @@ -0,0 +1,5 @@ +all: + children: + container_hosts: + hosts: + ch01.balsillie.house: diff --git a/playbooks/container-host.yml b/playbooks/container-host.yml new file mode 100644 index 0000000..9549d07 --- /dev/null +++ b/playbooks/container-host.yml @@ -0,0 +1,12 @@ +--- + +- name: Configure container hosts + hosts: + - ch01.balsillie.house + gather_facts: false + tasks: + + - name: Ping + become: true + ansible.builtin.ping: + data: "pong"