mirror of
https://github.com/trailofbits/algo.git
synced 2025-07-31 18:03:03 +02:00
Linode stackscript fix
This commit is contained in:
parent
96179b8915
commit
c184ad2e01
1 changed files with 10 additions and 3 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue