Last active
November 4, 2016 18:42
-
-
Save thomastaylor312/c1efefd1398fcc1ce858b0c561e42298 to your computer and use it in GitHub Desktop.
Example Ansible role file for populating Kubernetes YAML files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- include_vars: "group_vars/secrets/secrets_{{ k8s_environment }}_{{ jenkins_type }}.yml" | |
- name: "Jenkins specs directory" | |
file: | |
dest: "./build/{{ k8s_environment }}/" | |
state: directory | |
- name: "Jenkins environment directory" | |
file: | |
dest: "./build/{{ k8s_environment }}/jenkins" | |
state: directory | |
- name: "Set path where specs go" | |
set_fact: | |
spec_path: "./build/{{ k8s_environment }}/jenkins/{{ jenkins_type }}" | |
- name: "Jenkins type directory" | |
file: | |
dest: "{{ spec_path }}" | |
state: directory | |
- name: "Create jenkins secrets" | |
template: | |
src: "secrets.yml.j2" | |
dest: "{{ spec_path }}/secrets.yml" | |
mode: 0600 | |
- name: "Create jenkins namespace specification" | |
template: | |
src: namespace.yml.j2 | |
dest: "{{ spec_path }}/namespace.yml" | |
- name: "Create jenkins service" | |
template: | |
src: service.yml.j2 | |
dest: "{{ spec_path }}/service.yml" | |
- name: "Create jenkins" | |
template: | |
src: jenkins.yml.j2 | |
dest: "{{ spec_path }}/jenkins.yml" | |
- name: "Create jenkins deploy script" | |
template: | |
src: deploy.sh.j2 | |
dest: "{{ spec_path }}/deploy.sh" | |
- name: "Create jenkins undeploy script" | |
template: | |
src: undeploy.sh.j2 | |
dest: "{{ spec_path }}/undeploy.sh" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment