From af320f2341e0b93f4719d2e24d7c37aad1199b02 Mon Sep 17 00:00:00 2001 From: sam Date: Sun, 1 Mar 2026 00:47:27 -0700 Subject: [PATCH] Fix become passwords, stale children groups, and localhost sudo - Add ansible_become_pass to all hosts (sudo uses same password as SSH) - Remove truenas-scale and vyos from children groups (no connection info) - Add ansible.cfg: host_key_checking=False, become=False as default - Add become: false to wait_for_connection to avoid sudo during SSH test Co-Authored-By: Claude Sonnet 4.6 --- ansible.cfg | 7 +++++++ inventory/hosts.yml | 13 ++++++++----- playbooks/find_docker_enroll_portainer.yml | 1 + 3 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 ansible.cfg diff --git a/ansible.cfg b/ansible.cfg new file mode 100644 index 0000000..fbbcf82 --- /dev/null +++ b/ansible.cfg @@ -0,0 +1,7 @@ +[defaults] +# Do not prompt or fail on unknown host keys (Semaphore runner has no ~/.ssh/known_hosts) +host_key_checking = False + +# Disable become by default — playbooks/tasks set become: true explicitly where needed. +# This overrides any system-wide become=True in /etc/ansible/ansible.cfg on the runner. +become = False diff --git a/inventory/hosts.yml b/inventory/hosts.yml index d2e135c..64e2572 100644 --- a/inventory/hosts.yml +++ b/inventory/hosts.yml @@ -1,6 +1,5 @@ # Targeted inventory — first Docker discovery run -# 6 hosts manually selected for initial credential testing -# Replace CHANGEME with real credentials, then push to Gitea +# 5 hosts manually selected for initial credential testing all: hosts: @@ -11,24 +10,28 @@ all: ansible_user: sam ansible_ssh_pass: Lewiss4224@@@ ansible_become: true + ansible_become_pass: Lewiss4224@@@ ubuntu-server-02: ansible_host: 10.40.40.3 ansible_user: sam ansible_ssh_pass: Lewiss4224@@@ ansible_become: true + ansible_become_pass: Lewiss4224@@@ sp-ie-containerlab: ansible_host: 10.40.40.156 ansible_user: user ansible_ssh_pass: user ansible_become: true - + ansible_become_pass: user + vRouter-Host: ansible_host: 10.40.40.184 ansible_user: user ansible_ssh_pass: user ansible_become: true + ansible_become_pass: user # ── 192.168.1.0/24 ───────────────────────────────────────────────────── wazuh-graylog-server: @@ -36,6 +39,7 @@ all: ansible_user: user ansible_ssh_pass: user ansible_become: true + ansible_become_pass: user children: subnet_vlan40_10_40_40: @@ -43,9 +47,8 @@ all: ubuntu-server-01: {} ubuntu-server-02: {} sp-ie-containerlab: {} + vRouter-Host: {} subnet_vlan1_192_168_1: hosts: wazuh-graylog-server: {} - truenas-scale: {} - vyos: {} diff --git a/playbooks/find_docker_enroll_portainer.yml b/playbooks/find_docker_enroll_portainer.yml index 1423c43..6415607 100644 --- a/playbooks/find_docker_enroll_portainer.yml +++ b/playbooks/find_docker_enroll_portainer.yml @@ -27,6 +27,7 @@ ansible.builtin.wait_for_connection: timeout: 10 register: ssh_check + become: false ignore_errors: true - name: Gather minimal facts for reachable hosts