Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions files/cloud-init/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ users:
shell: /bin/bash
lock_passwd: true
ssh_authorized_keys:
- "{{ lookup('file', SSH_keys.public) }}"
- "{{ lookup('file', SSH_keys.public) | string }}"

write_files:
- path: /etc/ssh/sshd_config
content: |
{{ lookup('template', 'files/cloud-init/sshd_config') | indent(width=6, first=True) }}
{{ lookup('template', 'files/cloud-init/sshd_config') | string | indent(width=6, first=True) }}

runcmd:
- set -x
Expand Down
7 changes: 5 additions & 2 deletions roles/cloud-vultr/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
import_tasks: prompts.yml

- block:
- name: Set cloud-init script as fact
set_fact:
algo_cloud_init_script: "{{ lookup('template', 'files/cloud-init/base.yml') }}"

- name: Creating a firewall group
vultr.cloud.firewall_group:
name: "{{ algo_server_name }}"
Expand All @@ -28,8 +32,7 @@
- name: Upload the startup script
vultr.cloud.startup_script:
name: algo-startup
script: |
{{ lookup('template', 'files/cloud-init/base.yml') }}
script: "{{ algo_cloud_init_script }}"

- name: Creating a server
vultr.cloud.instance:
Expand Down
Loading