Linode stackscript fix

This commit is contained in:
Jack Ivanov 2020-08-08 12:30:08 +01:00
parent 96179b8915
commit c184ad2e01

View file

@ -5,6 +5,13 @@
- name: Include prompts
import_tasks: prompts.yml
- name: Set facts
set_fact:
stackscript: |
{{ lookup('template', 'files/cloud-init/base.sh') }}
mkdir -p /var/lib/cloud/data/ || true
touch /var/lib/cloud/data/result.json
- name: Create a stackscript
linode_stackscript_v4:
access_token: "{{ algo_linode_token }}"
@ -14,7 +21,7 @@
images:
- "{{ cloud_providers.linode.image }}"
script: |
{{ lookup('template', 'files/cloud-init/base.sh') }}
{{ stackscript }}
register: _linode_stackscript
- name: Update the stackscript
@ -24,11 +31,11 @@
body_format: json
body:
script: |
{{ lookup('template', 'files/cloud-init/base.sh') }}
{{ stackscript }}
headers:
Content-Type: application/json
Authorization: "Bearer {{ algo_linode_token }}"
when: (_linode_stackscript.stackscript.script | hash('md5')) != (lookup('template', 'files/cloud-init/base.sh') | hash('md5'))
when: (_linode_stackscript.stackscript.script | hash('md5')) != (stackscript | hash('md5'))
- name: "Creating an instance..."
linode_v4: