Created
August 8, 2023 13:08
-
-
Save tabrez/a56934e8c4a3d3cbf2fc0dc7c20c222a to your computer and use it in GitHub Desktop.
cloud init config file to setup a workstation vm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cloud-config | |
packages: | |
- ansible | |
users: | |
- default | |
- name: tabrez | |
sudo: ALL=(ALL) NOPASSWD:ALL | |
shell: /bin/bash | |
ssh_import_id: | |
- gh:tabrez | |
write_files: | |
- path: /setup.sh | |
owner: tabrez:tabrez | |
permissions: '0755' | |
encoding: text/plain | |
content: | | |
#!/bin/bash | |
mkdir /home/tabrez/work | |
git clone https://gitlab.com/tabrez/dominus.git /home/tabrez/dominus | |
cd /home/tabrez/dominus/headless-vm | |
echo "software" > /tmp/vault_pass | |
cp /home/tabrez/dominus/ansible.cfg /home/tabrez/.ansible.cfg | |
echo "localhost ansible_connection=local" > ini | |
roles="copy-private-ssh-key,ssh-config,config-local,utils,docker,neovim,astrovim,setup-root,jupyterlab" | |
# tags=$(echo $roles | tr ' ' ',') | |
ansible-playbook -i ini playbook.yml --tags "$roles" | |
runcmd: | |
- su - tabrez -c "/setup.sh" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment