Skip to content

Commit 6bc3e73

Browse files
Merge pull request #6290 from sjug/ansible_no_log
USHIFT-6646: Ansible: Do not log potentially sensitive data
2 parents 427f5c9 + e2cd432 commit 6bc3e73

5 files changed

Lines changed: 10 additions & 0 deletions

File tree

ansible/roles/add-kubelet-logging/tasks/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,20 @@
2222
register: bearer_token_slurp
2323
delegate_to: localhost
2424
become: false
25+
no_log: true
2526

2627
- name: Decode bearer token
2728
ansible.builtin.set_fact:
2829
bearer_token: "{{ bearer_token_slurp.content | b64decode }}"
30+
no_log: true
2931

3032
- name: Create metrics service account token file in prometheus folder
3133
ansible.builtin.copy:
3234
content: "{{ bearer_token }}"
3335
dest: "{{ kubelet_auth_token_file }}"
3436
mode: '0644'
3537
when: promdir.stat.exists
38+
no_log: true
3639

3740
- name: Remove the sa-token file
3841
ansible.builtin.file:

ansible/roles/create-service-account/tasks/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- name: create token for service account
1313
ansible.builtin.command: oc create token metrics-server -n kube-system --duration 720h
1414
register: token
15+
no_log: true
1516

1617
- name: remove metrics service account yaml
1718
ansible.builtin.file:
@@ -22,4 +23,6 @@
2223
ansible.builtin.copy:
2324
content: "{{ token.stdout }}"
2425
dest: "{{ sa_token_file }}"
26+
mode: '0600'
2527
delegate_to: localhost
28+
no_log: true

ansible/roles/install-logging/tasks/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
Accept: application/json
6161
Content-Type: application/json
6262
body: "{{ lookup('ansible.builtin.template', 'prometheus_datasource.json.j2') }}"
63+
no_log: true
6364

6465
- name: Create microshift perf dashboard in grafana
6566
ansible.builtin.uri:
@@ -73,3 +74,4 @@
7374
Accept: application/json
7475
Content-Type: application/json
7576
body: "{{ lookup('ansible.builtin.template', 'grafana_dashboard.json.j2') }}"
77+
no_log: true

ansible/roles/install-microshift/tasks/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@
163163
owner: root
164164
group: root
165165
mode: '0600'
166+
no_log: true
166167
when: not pull_secret.stat.exists
167168

168169
- name: check if crio metrics config is present

ansible/roles/manage-repos/tasks/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
state: present
2222
username: "{{ rhel_username }}"
2323
password: "{{ rhel_password }}"
24+
no_log: true
2425

2526
- name: Enable repo management from subscription-manager
2627
ansible.builtin.command: subscription-manager config --rhsm.manage_repos=1

0 commit comments

Comments
 (0)