Skip to content

Commit 77eae54

Browse files
committed
ansible-lint: fix YAML, file perms, changed_when
1 parent ba45498 commit 77eae54

File tree

8 files changed

+17
-19
lines changed

8 files changed

+17
-19
lines changed

.ansible-lint

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
---
22
skip_list:
33
- var-naming[no-role-prefix]
4-
- yaml[octal-values]
5-
- yaml[trailing-spaces]
6-
- yaml[truthy]
7-
- name[casing]
8-
- risky-file-permissions
94
- galaxy[no-changelog]
10-
- galaxy[tags]
115
- meta-runtime[unsupported-version]
12-
- no-changed-when
136
- fqcn[action-core]
147
- fqcn[action]

.github/workflows/pull_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Tests
22

33
# Controls when the action will run.
4-
on:
4+
'on':
55
pull_request:
66
push:
77
branches:

galaxy.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ dependencies:
99
license:
1010
- "Apache-2.0"
1111
tags:
12+
- consul
1213
- hashicorp
14+
- infrastructure
15+
- security
1316
- vault
14-
- consul
1517
repository: "https://github.com/stackhpc/ansible-collection-hashicorp"

roles/vault/tasks/vault.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
copy:
5454
content: "{{ vault_keys_result | to_nice_json }}"
5555
dest: "{{ vault_write_keys_file_path }}"
56-
mode: 0600
56+
mode: "0600"
5757
delegate_to: "{{ vault_write_keys_file_host }}"
5858
when:
5959
- vault_write_keys_file | bool

roles/vault_pki/tasks/create_cert.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
{{ item.data.issuing_ca }}
3434
{{ item.data.private_key }}
3535
dest: "{{ vault_pki_certificates_directory }}/{{ cert_name | replace(' ', '-') }}.pem"
36-
mode: 0600
36+
mode: "0600"
3737
delegate_to: "{{ vault_pki_write_certificates_host }}"
3838
loop: "{{ cert_data.results }}"
3939
loop_control:
@@ -52,7 +52,7 @@
5252
{{ item.data.certificate }}
5353
{{ item.data.issuing_ca }}
5454
dest: "{{ vault_pki_certificates_directory }}/{{ cert_name | replace(' ', '-') }}.crt"
55-
mode: 0600
55+
mode: "0600"
5656
delegate_to: "{{ vault_pki_write_certificates_host }}"
5757
loop: "{{ cert_data.results }}"
5858
loop_control:
@@ -61,7 +61,7 @@
6161
- not vault_pki_write_pem_bundle | bool
6262
- vault_pki_write_certificate_files | bool
6363
- not cert_file.stat.exists or vault_pki_overwrite_certificates | bool
64-
64+
6565
- name: "Write out key"
6666
vars:
6767
cert_name: "{{ item.item.common_name if item.item.common_name | default() | length > 0 else item.item.extra_params.ip_sans | default() }}"
@@ -70,7 +70,7 @@
7070
content: |
7171
{{ item.data.private_key }}
7272
dest: "{{ vault_pki_certificates_directory }}/{{ cert_name | replace(' ', '-') }}.key"
73-
mode: 0600
73+
mode: "0600"
7474
delegate_to: "{{ vault_pki_write_certificates_host }}"
7575
loop: "{{ cert_data.results }}"
7676
loop_control:

roles/vault_pki/tasks/intermediate.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
content: |
7575
{{ intermediate_ca_csr_signed.data.certificate }}
7676
dest: "{{ vault_pki_certificates_directory }}/{{ vault_pki_intermediate_ca_name | replace(' ', '-') }}.crt"
77-
mode: 0600
77+
mode: "0600"
7878
delegate_to: "{{ vault_pki_write_certificates_host }}"
7979
when:
8080
- vault_pki_write_int_ca_to_file | bool
@@ -86,7 +86,7 @@
8686
{{ intermediate_ca_csr_signed.data.issuing_ca }}
8787
{{ intermediate_ca_csr.data.private_key }}
8888
dest: "{{ vault_pki_certificates_directory }}/{{ vault_pki_intermediate_ca_name |replace(' ', '-') }}.pem"
89-
mode: 0600
89+
mode: "0600"
9090
delegate_to: "{{ vault_pki_write_certificates_host }}"
9191
when:
9292
- vault_pki_intermediate_export | bool

roles/vault_pki/tasks/root.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
content: |
3131
{{ root_ca_data.data.certificate }}
3232
dest: "{{ vault_pki_certificates_directory }}/{{ vault_pki_root_ca_name | replace(' ', '-') }}.pem"
33-
mode: 0600
33+
mode: "0600"
3434
delegate_to: "{{ vault_pki_write_certificates_host }}"
3535
when:
3636
- root_ca_data.data.certificate is defined

tests/test_vault.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
file:
1414
path: /etc/vault
1515
state: directory
16+
mode: "0700"
1617
become: true
1718

1819
- name: Include vault role
@@ -98,14 +99,15 @@
9899
- OS-CERT-TEST.crt
99100
- OS-CERT-TEST2.pem
100101

101-
- name: concatenate CAs
102+
- name: Concatenate CAs
102103
shell: |
103104
cat /tmp/OS-TLS-ROOT.pem /tmp/OS-TLS-INT.crt > /tmp/CA-CHAIN.pem
104105
args:
105106
executable: /bin/bash
106107
become: true
108+
changed_when: true
107109

108-
- name: verify certificate chain
110+
- name: Verify certificate chain
109111
command: |
110112
openssl verify -CAfile /tmp/CA-CHAIN.pem
111113
/tmp/{{ item }}
@@ -114,3 +116,4 @@
114116
loop:
115117
- OS-CERT-TEST.crt
116118
- OS-CERT-TEST2.pem
119+
changed_when: false

0 commit comments

Comments
 (0)