From eb387a1d1a867845331f896f647815c517a1a515 Mon Sep 17 00:00:00 2001 From: Allar Viik Date: Thu, 18 Jul 2024 18:04:25 +0300 Subject: [PATCH] Removed deprecated KeePass references from `machine_operations` role --- nova/core/galaxy.yml | 2 +- nova/core/roles/deploy_vars/defaults/main.yml | 2 +- .../roles/machine_operations/defaults/main.yml | 4 ++++ .../machine_operations/tasks/aws/main.yml | 18 ++++++------------ .../machine_operations/tasks/linode/main.yml | 18 ++++++------------ 5 files changed, 18 insertions(+), 26 deletions(-) diff --git a/nova/core/galaxy.yml b/nova/core/galaxy.yml index 2a5d4551..f354677f 100644 --- a/nova/core/galaxy.yml +++ b/nova/core/galaxy.yml @@ -8,7 +8,7 @@ namespace: nova name: core # The version of the collection. Must be compatible with semantic versioning -version: 3.1.15 +version: 3.1.16 # The path to the Markdown (.md) readme file. This path is relative to the root of the collection readme: README.md diff --git a/nova/core/roles/deploy_vars/defaults/main.yml b/nova/core/roles/deploy_vars/defaults/main.yml index a4e2e499..4827486c 100644 --- a/nova/core/roles/deploy_vars/defaults/main.yml +++ b/nova/core/roles/deploy_vars/defaults/main.yml @@ -4,7 +4,7 @@ ################### # These are defined here because it's the first role loaded and these defaults will then be used for subsequent roles -# It's better to define different lookups (vault, keepass etc.) in this role because then they'll be loaded only once +# It's better to define different lookups (vault,etc.) in this role because then they'll be loaded only once template: false # Set to yes to include the template role in start.yml customization_context: host # Default value, Providentia also can give out type: container diff --git a/nova/core/roles/machine_operations/defaults/main.yml b/nova/core/roles/machine_operations/defaults/main.yml index 0a54de6f..0fcf11a4 100644 --- a/nova/core/roles/machine_operations/defaults/main.yml +++ b/nova/core/roles/machine_operations/defaults/main.yml @@ -89,6 +89,8 @@ vmwarews_custom_params: [] # AWS defaults # ################ +aws_access_key: {} # Can be defined in your Ansible Vault + # Temporary ssh key path on your container temp_ssh_key_path: /tmp/{{ project_fullname | default('') }}_{{ inventory_hostname }}_aws_key @@ -135,6 +137,8 @@ aws_security_group_rules: # Linode defaults # ################### +linode_api_token: {} # Can be defined in your Ansible Vault + # The default root password for Linode VM machine_operations_linode_vm_password: "{{ lookup('community.hashi_vault.hashi_vault', vault_lookup_fragment + 'secret=' + secrets_vault_engine_path + '/data/' + secrets_vault_secrets_path + ':' + inventory_hostname + '_' + admin_account) }}" rebuild: false # Use ctp-rebuild alias to rebuild the VM with different size but keeping the data diff --git a/nova/core/roles/machine_operations/tasks/aws/main.yml b/nova/core/roles/machine_operations/tasks/aws/main.yml index 4c679d69..8669a5b0 100644 --- a/nova/core/roles/machine_operations/tasks/aws/main.yml +++ b/nova/core/roles/machine_operations/tasks/aws/main.yml @@ -1,16 +1,10 @@ --- -- name: Checking for AWS API key... - when: aws_access_key is not defined or aws_access_key in [none, ''] - block: - - name: MISSING AWS API KEY - ansible.builtin.debug: - msg: | - KEEPASS_AWS_ACCESS_KEY not defined in .makerc-vars. - or - aws_access_key_id and aws_access_key are not set in Ansible Vault. - - - name: Stopping play... - ansible.builtin.meta: end_host +- name: Missing required variables... + ansible.builtin.fail: + msg: | + Following variables are required to run this role: + - aws_access_key + when: aws_access_key == {} - name: Including {{ custom_vm_name | default(vm_name) }} removal tasks... ansible.builtin.include_tasks: remove.yml diff --git a/nova/core/roles/machine_operations/tasks/linode/main.yml b/nova/core/roles/machine_operations/tasks/linode/main.yml index 068a6f3d..fada6411 100644 --- a/nova/core/roles/machine_operations/tasks/linode/main.yml +++ b/nova/core/roles/machine_operations/tasks/linode/main.yml @@ -1,16 +1,10 @@ --- -- name: Checking for Linode API token... - when: linode_api_token is not defined or linode_api_token in [none, ''] - block: - - name: MISSING LINODE API TOKEN - ansible.builtin.debug: - msg: | - KEEPASS_LINODE_API_TOKEN not defined in .makerc-vars. - or - linode_api_token is not set in Ansible Vault. - - - name: Stopping play... - ansible.builtin.meta: end_host +- name: Missing required variables... + ansible.builtin.fail: + msg: | + Following variables are required to run this role: + - linode_api_token + when: linode_api_token == {} - name: Including {{ custom_vm_name | default(vm_name) }} rebuild tasks... ansible.builtin.include_tasks: rebuild.yml