feat(pb): makes human admin user optional #27
@@ -33,6 +33,11 @@
|
|||||||
default: true
|
default: true
|
||||||
private: false
|
private: false
|
||||||
|
|
||||||
|
- name: lxc_create_human_admin_user
|
||||||
|
prompt: "Create human admin user? (true/false)?"
|
||||||
|
default: true
|
||||||
|
private: false
|
||||||
|
|
||||||
pre_tasks:
|
pre_tasks:
|
||||||
- name: Validate hostname
|
- name: Validate hostname
|
||||||
ansible.builtin.fail:
|
ansible.builtin.fail:
|
||||||
@@ -57,12 +62,15 @@
|
|||||||
- name: Make the prompted hostname available to the whole playbook
|
- name: Make the prompted hostname available to the whole playbook
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
fact_lxc_hostname: "{{ lxc_hostname }}"
|
fact_lxc_hostname: "{{ lxc_hostname }}"
|
||||||
|
|
||||||
- name: Make the prompted IP available to the whole playbook
|
- name: Make the prompted IP available to the whole playbook
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
#fact_lxc_ip_address: "{{ lxc_ip_address | ansible.utils.ipaddr('address') }}"
|
|
||||||
fact_lxc_ip_address: "{{ lxc_ip_address.split('/') | first }}"
|
fact_lxc_ip_address: "{{ lxc_ip_address.split('/') | first }}"
|
||||||
|
|
||||||
|
- name: Make the "human admin user" selection available to the whole playbook
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
fact_lxc_create_human_admin_user: "{{ lxc_create_human_admin_user }}"
|
||||||
|
|
||||||
- name: Add the target host to the inventory
|
- name: Add the target host to the inventory
|
||||||
ansible.builtin.add_host:
|
ansible.builtin.add_host:
|
||||||
name: "{{ fact_lxc_ip_address }}"
|
name: "{{ fact_lxc_ip_address }}"
|
||||||
@@ -85,7 +93,15 @@
|
|||||||
- ../roles/configure_ansible_user
|
- ../roles/configure_ansible_user
|
||||||
- ../roles/harden_ssh
|
- ../roles/harden_ssh
|
||||||
- ../roles/base_system
|
- ../roles/base_system
|
||||||
- ../roles/human_admin_user
|
|
||||||
# Update configs - omz, nvim, ranger and so on. Distribute the last version of those configs
|
tasks:
|
||||||
- ../roles/update_configs
|
- name: Include human admin user role
|
||||||
|
ansible.builtin.include_role:
|
||||||
|
name: ../roles/human_admin_user
|
||||||
|
when: "hostvars['localhost']['fact_lxc_create_human_admin_user'] | bool"
|
||||||
|
|
||||||
|
- name: Include update configs role
|
||||||
|
ansible.builtin.include_role:
|
||||||
|
name: ../roles/update_configs
|
||||||
|
when: "hostvars['localhost']['fact_lxc_create_human_admin_user'] | bool"
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,11 @@
|
|||||||
default: "sudo"
|
default: "sudo"
|
||||||
private: false
|
private: false
|
||||||
|
|
||||||
|
- name: vm_create_human_admin_user
|
||||||
|
prompt: "Create human admin user? (true/false)?"
|
||||||
|
default: true
|
||||||
|
private: false
|
||||||
|
|
||||||
- name: vm_ip_address
|
- name: vm_ip_address
|
||||||
prompt: "IP address for the VM (in x.x.x.x/x formant)"
|
prompt: "IP address for the VM (in x.x.x.x/x formant)"
|
||||||
default: "192.168.0.89/24"
|
default: "192.168.0.89/24"
|
||||||
@@ -80,6 +85,10 @@
|
|||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
fact_vm_ip_address: "{{ vm_ip_address.split('/') | first }}"
|
fact_vm_ip_address: "{{ vm_ip_address.split('/') | first }}"
|
||||||
|
|
||||||
|
- name: Make the "human admin user" selection available to the whole playbook
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
fact_vm_create_human_admin_user: "{{ vm_create_human_admin_user }}"
|
||||||
|
|
||||||
- name: Add the target host to the inventory
|
- name: Add the target host to the inventory
|
||||||
ansible.builtin.add_host:
|
ansible.builtin.add_host:
|
||||||
name: "{{ fact_vm_ip_address }}"
|
name: "{{ fact_vm_ip_address }}"
|
||||||
@@ -103,7 +112,15 @@
|
|||||||
- ../roles/configure_ansible_user
|
- ../roles/configure_ansible_user
|
||||||
- ../roles/harden_ssh
|
- ../roles/harden_ssh
|
||||||
- ../roles/base_system
|
- ../roles/base_system
|
||||||
- ../roles/human_admin_user
|
|
||||||
# Update configs - omz, nvim, ranger and so on. Distribute the last version of those configs
|
tasks:
|
||||||
- ../roles/update_configs
|
- name: Include human admin user role
|
||||||
|
ansible.builtin.include_role:
|
||||||
|
name: ../roles/human_admin_user
|
||||||
|
when: "hostvars['localhost']['fact_vm_create_human_admin_user'] | bool"
|
||||||
|
|
||||||
|
- name: Include update configs role
|
||||||
|
ansible.builtin.include_role:
|
||||||
|
name: ../roles/update_configs
|
||||||
|
when: "hostvars['localhost']['fact_vm_create_human_admin_user'] | bool"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user