Andrew Block
2018-09-15 c47c70e780c2f7e3e1482c3dbdc2c2738cf3e712
Support for configuring Jenkins for CICD lab
1 files added
1 files modified
30 ■■■■■ changed files
ansible/configs/ansible-cicd-lab/jenkins_ssh_setup.yml 25 ●●●●● patch | view | raw | blame | history
ansible/configs/ansible-cicd-lab/post_software.yml 5 ●●●●● patch | view | raw | blame | history
ansible/configs/ansible-cicd-lab/jenkins_ssh_setup.yml
New file
@@ -0,0 +1,25 @@
---
- name: Retrieve SSH File from Bastion
  slurp:
    src: "/root/.ssh/{{ guid }}key.pem"
  register: bastion_ssh_key
  no_log: True
  delegate_to: "{{ bastion_host }}"
- name: Create Jenkins SSH Directory
  file:
    state: directory
    path: /var/lib/jenkins/.ssh
    mode: 700
    owner: jenkins
    group: jenkins
- name: Set SSH Key
  copy:
    content: "{{ bastion_ssh_key.content | b64decode }}"
    dest: /var/lib/jenkins/.ssh/id_rsa
    owner: jenkins
    group: jenkins
    mode: 600
  no_log: True
ansible/configs/ansible-cicd-lab/post_software.yml
@@ -39,6 +39,11 @@
  tasks:
    - name: include docker_setup tasks
      include_tasks: docker_setup.yml
  post_tasks:
    - name: Jenkins SSH Configuration
      include_tasks: jenkins_ssh_setup.yml
      vars:
        bastion_host: "{{ groups['bastions'][0] }}"
- hosts: bastions
  become: false