Skip to content

Commit

Permalink
fix(ansible): fix the naming of the variable
Browse files Browse the repository at this point in the history
Ansible linting requires variables to be prefixed with the role name.

Signed-off-by: Matej Focko <[email protected]>
  • Loading branch information
mfocko committed Oct 11, 2023
1 parent ec1c805 commit 170809b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
---
- name: Create secrets directory hierarchy
ansible.builtin.file:
path: "{{ path_to_secrets }}"
path: "{{ generate_secrets_path }}"
state: directory
mode: 0755
14 changes: 7 additions & 7 deletions playbooks/roles/generate_secrets/tasks/generate-cert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

- name: Generate OpenSSL private keys
openssl_privatekey:
path: "{{ path_to_secrets }}/{{ item }}"
path: "{{ generate_secrets_path }}/{{ item }}"
loop:
- private-key.pem
- privkey.pem
Expand All @@ -19,24 +19,24 @@

- name: Generate OpenSSL CSR
openssl_csr:
path: "{{ path_to_secrets }}/{{ item.csr }}"
privatekey_path: "{{ path_to_secrets }}/{{ item.key }}"
path: "{{ generate_secrets_path }}/{{ item.csr }}"
privatekey_path: "{{ generate_secrets_path }}/{{ item.key }}"
common_name: localhost
loop:
- { key: privkey.pem, csr: fullchain.csr }

- name: Generate Self Signed OpenSSL certificate
openssl_certificate:
path: "{{ path_to_secrets }}/{{ item.cert }}"
privatekey_path: "{{ path_to_secrets }}/{{ item.key }}"
csr_path: "{{ path_to_secrets }}/{{ item.csr }}"
path: "{{ generate_secrets_path }}/{{ item.cert }}"
privatekey_path: "{{ generate_secrets_path }}/{{ item.key }}"
csr_path: "{{ generate_secrets_path }}/{{ item.csr }}"
provider: selfsigned
loop:
- { cert: fullchain.pem, key: privkey.pem, csr: fullchain.csr }

- name: Remove CSR
ansible.builtin.file:
path: "{{ path_to_secrets }}/{{ item }}"
path: "{{ generate_secrets_path }}/{{ item }}"
state: absent
loop:
- fullchain.csr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- name: Generate config files
ansible.builtin.copy:
src: "{{ item }}"
dest: "{{ path_to_secrets }}/{{ item }}"
dest: "{{ generate_secrets_path }}/{{ item }}"
mode: 0644
loop:
- packit-service.yaml.j2
Expand Down
2 changes: 1 addition & 1 deletion playbooks/roles/generate_secrets/tasks/generate-ssh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
---
- name: Generate an OpenSSH keypair with the default values (4096 bits, rsa)
openssh_keypair:
path: "{{ path_to_secrets }}/id_ed25519"
path: "{{ generate_secrets_path }}/id_ed25519"
type: "ed25519"
2 changes: 1 addition & 1 deletion playbooks/roles/generate_secrets/tasks/touch-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
---
- name: Create empty files
ansible.builtin.file:
path: "{{ path_to_secrets }}/{{ item }}"
path: "{{ generate_secrets_path }}/{{ item }}"
state: touch
mode: 0644
loop:
Expand Down
2 changes: 1 addition & 1 deletion playbooks/roles/generate_secrets/vars/main.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
path_to_secrets: "{{ generate_secrets_project_dir }}/secrets/packit/dev"
generate_secrets_path: "{{ generate_secrets_project_dir }}/secrets/packit/dev"

0 comments on commit 170809b

Please sign in to comment.