ansible: add config for minimal vm
This commit is contained in:
parent
ef6dc0acd5
commit
a5e16cac00
@ -14,6 +14,7 @@ common_base_packages:
|
|||||||
- ca-certificates
|
- ca-certificates
|
||||||
- cifs-utils
|
- cifs-utils
|
||||||
- curl
|
- curl
|
||||||
|
- cups
|
||||||
- exa
|
- exa
|
||||||
- git
|
- git
|
||||||
- python3-pip
|
- python3-pip
|
||||||
|
|||||||
@ -2,3 +2,6 @@
|
|||||||
vm-media-100-55 ansible_host=192.168.100.55 ansible_user=tylen
|
vm-media-100-55 ansible_host=192.168.100.55 ansible_user=tylen
|
||||||
vm-tools-100-65 ansible_host=192.168.100.65 ansible_user=tylen
|
vm-tools-100-65 ansible_host=192.168.100.65 ansible_user=tylen
|
||||||
vm-network-100-75 ansible_host=192.168.100.75 ansible_user=tylen
|
vm-network-100-75 ansible_host=192.168.100.75 ansible_user=tylen
|
||||||
|
|
||||||
|
[misc]
|
||||||
|
vm-printer-100-20 ansible_host=192.168.100.20 ansible_user=tylen
|
||||||
|
|||||||
43
ansible/worker/init_no_docker.yaml
Normal file
43
ansible/worker/init_no_docker.yaml
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
|
||||||
|
---
|
||||||
|
- name: Initialise worker VM
|
||||||
|
hosts: misc
|
||||||
|
become: yes
|
||||||
|
vars_files:
|
||||||
|
- worker_vars.yaml
|
||||||
|
- ../common_vars.yaml
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Install essentials
|
||||||
|
apt:
|
||||||
|
name: "{{ common_base_packages }}"
|
||||||
|
state: latest
|
||||||
|
update_cache: true
|
||||||
|
ignore_errors: yes
|
||||||
|
|
||||||
|
|
||||||
|
- name: Create a login user
|
||||||
|
user:
|
||||||
|
name: "{{ vm_username }}"
|
||||||
|
password: "$6$OhH/TOtjPdxJgC9i$1ytWcV0yBuv5b4Momkka57tErCc4UqvG0zqydyyGQm3OXSaWPHTLHxvPjeCdA9B8T0./eXawj62xZ7gVtzokG/"
|
||||||
|
groups:
|
||||||
|
- sudo
|
||||||
|
state: present
|
||||||
|
shell: /usr/bin/bash
|
||||||
|
|
||||||
|
- name: Copy authorized keys
|
||||||
|
authorized_key:
|
||||||
|
user: "{{ vm_username }}"
|
||||||
|
key: "{{ lookup('file', '{{ ssh_access_keys }}') }}"
|
||||||
|
|
||||||
|
- name: Download rc files
|
||||||
|
get_url:
|
||||||
|
url: "{{ item.url }}"
|
||||||
|
dest: "{{ item.dest }}"
|
||||||
|
mode: '0644'
|
||||||
|
loop:
|
||||||
|
- { url: '{{ bashrc_file_url }}', dest: '{{ bashrc_mount_path }}' }
|
||||||
|
- { url: '{{ vimrc_file_url }}', dest: '{{ vimrc_mount_path }}' }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user