mirror of
https://github.com/trailofbits/algo.git
synced 2025-08-02 10:53:01 +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
|
- name: Include prompts
|
||||||
import_tasks: prompts.yml
|
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
|
- name: Create a stackscript
|
||||||
linode_stackscript_v4:
|
linode_stackscript_v4:
|
||||||
access_token: "{{ algo_linode_token }}"
|
access_token: "{{ algo_linode_token }}"
|
||||||
|
@ -14,7 +21,7 @@
|
||||||
images:
|
images:
|
||||||
- "{{ cloud_providers.linode.image }}"
|
- "{{ cloud_providers.linode.image }}"
|
||||||
script: |
|
script: |
|
||||||
{{ lookup('template', 'files/cloud-init/base.sh') }}
|
{{ stackscript }}
|
||||||
register: _linode_stackscript
|
register: _linode_stackscript
|
||||||
|
|
||||||
- name: Update the stackscript
|
- name: Update the stackscript
|
||||||
|
@ -24,11 +31,11 @@
|
||||||
body_format: json
|
body_format: json
|
||||||
body:
|
body:
|
||||||
script: |
|
script: |
|
||||||
{{ lookup('template', 'files/cloud-init/base.sh') }}
|
{{ stackscript }}
|
||||||
headers:
|
headers:
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
Authorization: "Bearer {{ algo_linode_token }}"
|
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..."
|
- name: "Creating an instance..."
|
||||||
linode_v4:
|
linode_v4:
|
||||||
|
|
Loading…
Add table
Reference in a new issue