Skip to content

Commit

Permalink
wip: Update cloud-config replacing placeholders
Browse files Browse the repository at this point in the history
  • Loading branch information
jcfr committed May 3, 2024
1 parent 802c1b1 commit a5a1a20
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions cloud-config
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ users:
- name: exouser
shell: /bin/bash
groups: sudo, admin
sudo: ['ALL=(ALL) NOPASSWD:ALL']{ssh-authorized-keys}
sudo: ['ALL=(ALL) NOPASSWD:ALL']
# {ssh-authorized-keys}
ssh_pwauth: true
package_update: true
package_upgrade: {install-os-updates}
package_upgrade: true # {install-os-updates}
packages:
- git{write-files}
runcmd:
Expand All @@ -16,20 +17,23 @@ runcmd:
- >-
echo '{"status":"running", "epoch": '$(date '+%s')'000}' | tee --append /dev/console > /dev/kmsg || true
- chmod 640 /var/log/cloud-init-output.log
- {create-cluster-command}
# - {create-cluster-command}
- (which apt-get && apt-get install -y python3-venv) # Install python3-venv on Debian-based platforms
- (which yum && yum install -y python3) # Install python3 on RHEL-based platforms
- |-
python3 -m venv /opt/ansible-venv
. /opt/ansible-venv/bin/activate
pip install --upgrade pip
pip install ansible-core
# --url "{instance-config-mgt-repo-url}"
# --checkout "{instance-config-mgt-repo-checkout}"
# -e "{ansible-extra-vars}"
ansible-pull \
--url "{instance-config-mgt-repo-url}" \
--checkout "{instance-config-mgt-repo-checkout}" \
--url "https://gitlab.com/exosphere/exosphere.git" \
--checkout "master" \
--directory /opt/instance-config-mgt \
-i /opt/instance-config-mgt/ansible/hosts \
-e "{ansible-extra-vars}" \
-e "{\"guac_enabled\":true,\"gui_enabled\":true}" \
/opt/instance-config-mgt/ansible/playbook.yml
- ANSIBLE_RETURN_CODE=$?
- if [ $ANSIBLE_RETURN_CODE -eq 0 ]; then STATUS="complete"; else STATUS="error"; fi
Expand Down

0 comments on commit a5a1a20

Please sign in to comment.