---
#
# We need to be careful to use "no_log" here and beloww, or else we
# could leak the credentials in the Ansible log when it's run in
# verbose mode.
#
- name: Load secret files.
  include_vars: "secret_files.yml"
  no_log: true

- name: Copy secret files.
  copy:
    dest: "{{ item.key }}"
    content: "{{ item.value.content }}"
    owner: "{{ item.value.owner }}"
    group: "{{ item.value.group }}"
    mode: "{{ item.value.mode }}"
  with_dict: secret_files
  no_log: true

---
- name: Create Jenkins user's .ssh directory
  file:
    path: "~jenkins/.ssh"
    state: "directory"
    owner: "jenkins"
    group: "jenkins"
    mode: "0700"

#
# We need to be careful to use "no_log" here and beloww, or else we
# could leak the credentials in the Ansible log when it's run in
# verbose mode.
#
- name: Load secret files.
  include_vars: "secret_files.yml"
  no_log: true

- name: Copy secret files.
  copy:
    dest: "{{ item.key }}"
    content: "{{ item.value.content }}"
    owner: "{{ item.value.owner }}"
    group: "{{ item.value.group }}"
    mode: "{{ item.value.mode }}"
  with_dict: secret_files
  no_log: true

Create the Jenkins user's .ssh directory
Create the Jenkins user's .ssh directory

Prior to copying the Jenkins user's ssh key, we need to ensure the
Jenkins user's .ssh directory exists; otherwise Ansible playbook
failures can occur when applying the private jenkins playbook.
