From: nicoo Date: Sat, 24 Nov 2018 22:06:39 +0000 (+0100) Subject: ansible: Unify default credentials X-Git-Url: https://git.realraum.at/?a=commitdiff_plain;h=60e83c4c6c86c727b96cf5a6135a6bb227535333;p=noc.git ansible: Unify default credentials --- diff --git a/ansible/group_vars/all/main.yml b/ansible/group_vars/all/main.yml index 882caa0..1301aef 100644 --- a/ansible/group_vars/all/main.yml +++ b/ansible/group_vars/all/main.yml @@ -3,3 +3,8 @@ global_cache_dir: "{{ inventory_dir }}/.cache/" global_artifacts_dir: "{{ inventory_dir }}/files/" +# Default credentials +## Root password; by default, undefined +root_password: "{{ vault_root_password }}" +## SSH keys for root, default to NOC's +ssh_keys: "{{ noc_ssh_keys }}" diff --git a/ansible/host_vars/gnocci0/main.yml b/ansible/host_vars/gnocci0/main.yml index 6e18bed..21e708c 100644 --- a/ansible/host_vars/gnocci0/main.yml +++ b/ansible/host_vars/gnocci0/main.yml @@ -1,6 +1,4 @@ --- -root_password: "{{ vault_root_password }}" - network: nameservers: - 10.12.0.10 diff --git a/ansible/host_vars/gnocci1/main.yml b/ansible/host_vars/gnocci1/main.yml index 8a8e1a3..20b3247 100644 --- a/ansible/host_vars/gnocci1/main.yml +++ b/ansible/host_vars/gnocci1/main.yml @@ -1,6 +1,4 @@ --- -root_password: "{{ vault_root_password }}" - network: nameservers: - 10.12.0.10 diff --git a/ansible/roles/base/tasks/main.yml b/ansible/roles/base/tasks/main.yml index a0545df..c155be4 100644 --- a/ansible/roles/base/tasks/main.yml +++ b/ansible/roles/base/tasks/main.yml @@ -47,7 +47,7 @@ - name: Set authorized keys for root user authorized_key: user: root - key: "{{ noc_ssh_keys | join('\n') }}" + key: "{{ ssh_keys | join('\n') }}" exclusive: yes - name: disable apt suggests and recommends diff --git a/ansible/roles/preseed/defaults/main.yml b/ansible/roles/preseed/defaults/main.yml index 9b25865..e69de29 100644 --- a/ansible/roles/preseed/defaults/main.yml +++ b/ansible/roles/preseed/defaults/main.yml @@ -1 +0,0 @@ -ssh_keys: "{{ noc_ssh_keys }}" diff --git a/ansible/roles/vm/install/meta/main.yml b/ansible/roles/vm/install/meta/main.yml index 696479f..9d10818 100644 --- a/ansible/roles/vm/install/meta/main.yml +++ b/ansible/roles/vm/install/meta/main.yml @@ -1,6 +1,5 @@ --- dependencies: - role: preseed - # TODO: Find a way to eliminate the duplicate defaults. - ssh_keys: "{{ hostvars[hostname].ssh_keys | default(noc_ssh_keys) }}" + ssh_keys: "{{ hostvars[hostname].ssh_keys }}" install_interface: enp1s1