Commit 565e39ba by Brian Beggs

Updates to the CD ansible plays to better accommodate how GoCD handles artifacts

parent 4c2bb694
......@@ -45,7 +45,7 @@
- name: cleanup local file system
file:
path: "{{ artifact_path }}/{{ keypair_id }}"
path: "{{ artifact_path }}"
state: absent
- name: Send Hipchat notification cleanup has finished
......@@ -54,5 +54,6 @@
token: "{{ hipchat_token }}"
room: "{{ hipchat_room }}"
msg: "Cleanup for run id: {{ keypair_id }} complete."
ignore_errors: yes
when: hipchat_token is defined
......@@ -31,7 +31,7 @@
# ansible-playbook -vvvv -i "localhost," -c local \
# -e @overrides.yml \
# -e @/tmp/ansible-runtime/d057a5d9-4fc5-4a21-9646-4c135be0b7c8/launch_info.yml \
# -e cluster=pipline-test \
# -e play=pipline-test \
# -e deployment=edx \
# -e edx_environment=sandbox \
# -e cluster_version=12345 \
......@@ -52,7 +52,6 @@
gather_facts: False
connection: local
tasks:
- name: Create AMI
ec2_ami_2_0_0_1:
instance_id: "{{ instance_id }}"
......@@ -82,10 +81,16 @@
version:edxapp_theme: "{{ edx_app_theme_repo }} {{ edx_app_theme_version }}"
when: edx_app_theme_version is defined and edx_app_theme_repo is defined
- name: Ensure artifact directory exists
file:
path: "{{ artifact_path }}"
state: directory
force: yes
- name: Generate artifact container the instance_id
template:
src: templates/local/ami_template.yml.j2
dest: "{{ artifact_path }}/{{ keypair_id }}/ami.yml"
dest: "{{ artifact_path }}/ami.yml"
mode: 0600
- name: Send Hipchat notification AMI is finished baking
......
......@@ -46,7 +46,7 @@
- name: Ensure artifact directory exists
file:
path: "{{ artifact_path }}/{{ unique_key_name.stdout }}/"
path: "{{ artifact_path }}"
state: directory
force: yes
......@@ -81,13 +81,13 @@
- name: Generate artifact for jobs down stream
template:
src: templates/local/launch_template.yml.j2
dest: "{{ artifact_path }}/{{ unique_key_name.stdout }}/launch_info.yml"
dest: "{{ artifact_path }}/launch_info.yml"
mode: 0600
- name: Generate key material artifact for jobs down stream
template:
src: templates/local/key.pem.j2
dest: "{{ artifact_path }}/{{ unique_key_name.stdout }}/key.pem"
dest: "{{ artifact_path }}/key.pem"
mode: 0600
keypair_id: {{ unique_key_name.stdout }}
key_material_file: {{ artifact_path }}/{{ unique_key_name.stdout }}/key.pem
key_material_file: {{ artifact_path }}/key.pem
instance_id: {{ ec2_instance_register.instances[0].id }}
instance_ip: {{ ec2_instance_register.instances[0].private_ip }}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment