x
This commit is contained in:
+1
-6
@@ -1,4 +1,4 @@
|
||||
|
||||
iris.heath.hpetersenfamily.com admin-a.hpetersenfamily.com core.mary.hpetersenfamily.com
|
||||
|
||||
heath
|
||||
authorized_keys:
|
||||
@@ -6,8 +6,6 @@ heath
|
||||
password:
|
||||
status: VALID
|
||||
value: COMMON STRONG FOR ALL HOSTS
|
||||
private_keys:
|
||||
- FOR WORKSTATIONS: heath@hpetersenfamily.com # Can this even be done securely through Ansible?
|
||||
first
|
||||
authorized_keys:
|
||||
- first@hpetersenfamily.com
|
||||
@@ -15,19 +13,16 @@ first
|
||||
password:
|
||||
status: VALID
|
||||
value: UNIQUE LONG FOR EACH HOST
|
||||
private_keys:
|
||||
root
|
||||
authorized_keys:
|
||||
- heath@hpetersenfamily.com
|
||||
password:
|
||||
status: LOCKED
|
||||
private_keys:
|
||||
hpf-ans:
|
||||
authorized_keys:
|
||||
- heath@hpetersenfamily.com
|
||||
password:
|
||||
status: LOCKED
|
||||
private_keys:
|
||||
|
||||
|
||||
# Change to work with multiple distros (nothing hardcoded)
|
||||
|
||||
@@ -1,34 +1,29 @@
|
||||
---
|
||||
|
||||
- name: test-get_hpf_facts.yml
|
||||
- name: test-get-hpf-facts.yml
|
||||
hosts: all
|
||||
|
||||
tasks:
|
||||
|
||||
- name: Copy over get_hpf_facts.sh
|
||||
- name: Copy over get-hpf-facts.sh
|
||||
ansible.builtin.copy:
|
||||
src: hpf-ans/bin/get_hpf_facts.sh
|
||||
dest: bin/get_hpf_facts.sh
|
||||
src: home/hpf-ans/bin/get-hpf-facts.sh
|
||||
dest: bin/get-hpf-facts.sh
|
||||
owner: hpf-ans
|
||||
group: hpf-ans
|
||||
mode: u=rwx,go=gx
|
||||
backup: true
|
||||
|
||||
- name: Run get_hpf_facts.sh
|
||||
- name: Run get-hpf-facts.sh
|
||||
ansible.builtin.command:
|
||||
cmd: bin/get_hpf_facts.sh {{ ansible_facts["os_family"] }}
|
||||
register: hpf_facts
|
||||
cmd: bin/get-hpf-facts.sh {{ ansible_facts["os_family"] }}
|
||||
register: registered_hpf_facts
|
||||
changed_when: false
|
||||
|
||||
- name: Convert k=v stdout into facts
|
||||
ansible.builtin.set_fact:
|
||||
"{{ item.split('=', 1)[0] }}": "{{ item.split('=', 1)[1] }}"
|
||||
loop: "{{ hpf_facts.stdout.splitlines() }}"
|
||||
|
||||
- name: Print all variables
|
||||
ansible.builtin.debug:
|
||||
var: hostvars[inventory_hostname]
|
||||
hpf_facts: "{{ registered_hpf_facts.stdout | from_json }}"
|
||||
|
||||
- name: Print skel
|
||||
ansible.builtin.debug:
|
||||
var: hpf_fact_skel
|
||||
var: hpf_facts.skel
|
||||
|
||||
Reference in New Issue
Block a user