feat: Add swag container

This commit is contained in:
Lino Silva
2023-03-20 14:56:20 +00:00
parent fbd6e53083
commit cfecd0afd8
37 changed files with 1564 additions and 10 deletions
@@ -0,0 +1,28 @@
---
- name: Create container
community.general.proxmox:
vmid: 606
node: mipha
api_user: root@pam
api_password: "{{ proxmox_api_password }}"
api_host: 10.0.2.2
password: "{{ lxc_password }}"
hostname: swag
ostemplate: "hyrule-8tb-nfs:vztmpl/debian-11-standard_11.3-1_amd64.tar.zst"
netif: "{'net0':'name=eth0,\
gw=10.0.0.1,\
ip=10.0.2.15/21,\
hwaddr=cc:c6:cf:de:17:75,\
bridge=vmbr0'}"
cores: 1
memory: 6144
unprivileged: no
swap: 0
searchdomain: "home"
onboot: 1
mounts: '{"mp0":"local-lvm:5,mp=/data,backup=1"}'
features:
- nesting=1
- keyctl=1
disk: local-lvm:30
force: yes
@@ -0,0 +1,26 @@
---
- name: Stop container
community.general.proxmox:
vmid: 606
api_user: root@pam
api_password: "{{ proxmox_api_password }}"
api_host: 10.0.2.2
state: stopped
ignore_errors: true
timeout: 90
- name: Remove containers
community.general.proxmox:
vmid: 606
api_user: root@pam
api_password: "{{ proxmox_api_password }}"
api_host: 10.0.2.2
state: absent
ignore_errors: true
timeout: 90
- name: Remove .ssh/known_hosts lines
ansible.builtin.lineinfile:
path: /Users/lino.silva/.ssh/known_hosts
state: absent
regexp: "^10.0.2.15"
@@ -0,0 +1,8 @@
---
# Unable to use ansible.builtin.lineinfile, because we need to run this through the proxmox host (because SSH is not enabled duh)
- name: Allow SSH into LXC
ansible.builtin.command: lxc-attach -n 606 -- sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
- name: Restart SSH Service
ansible.builtin.command: lxc-attach -n 606 service ssh restart
@@ -0,0 +1,8 @@
---
- name: Start deployments
community.general.proxmox:
vmid: 606
api_user: root@pam
api_password: "{{ proxmox_api_password }}"
api_host: 10.0.2.2
state: started