Dev to main #1
@@ -0,0 +1,11 @@
|
||||
---
|
||||
- name: Deploy and set up an LXC container in Proxmox
|
||||
hosts: all
|
||||
remote_user: ansible
|
||||
roles:
|
||||
- ../roles/deploy_lxc_on_proxmox
|
||||
vars_files:
|
||||
../inventory/group_vars/all/secrets.yaml
|
||||
vars:
|
||||
ansible_user_passwd_hash: "{{ ansible_password | password_hash('sha512', 's3edscrj45e6r') }}"
|
||||
user_passwd_hash: "{{ user_password | password_hash('sha512', 's3ed6123jhgcr') }}"
|
||||
+20
-3
@@ -2,11 +2,28 @@
|
||||
- name: Physical machines maintanance play
|
||||
hosts: all
|
||||
remote_user: ansible
|
||||
roles:
|
||||
- ../roles/common_healthcheck
|
||||
|
||||
vars_files:
|
||||
../inventory/group_vars/all/secrets.yaml
|
||||
vars:
|
||||
ansible_user_passwd_hash: "{{ ansible_password | password_hash('sha512', 's3edscrj45e6r') }}"
|
||||
user_passwd_hash: "{{ user_password | password_hash('sha512', 's3ed6123jhgcr') }}"
|
||||
ha_addr: https://ha.lan
|
||||
|
||||
vars_prompt:
|
||||
- name: lxc_hostname
|
||||
prompt: "Hostname for the container:"
|
||||
private: false
|
||||
|
||||
- name: lxc_root_password
|
||||
prompt: "Root password:"
|
||||
private: true
|
||||
confirm: true
|
||||
encrypt: sha512_crypt
|
||||
|
||||
- name: lxc_ip_address
|
||||
prompt: "IP address for the container (in x.x.x.x/x formant):"
|
||||
private: false
|
||||
|
||||
|
||||
roles:
|
||||
- ../roles/deploy_lxc_on_proxmox
|
||||
|
||||
+9
-8
@@ -1,6 +1,6 @@
|
||||
---
|
||||
|
||||
- name: Create new container with minimal options defining network interface with static ip
|
||||
- name: Create a new container with minimal options defining network interface with static ip
|
||||
become: false
|
||||
community.proxmox.proxmox:
|
||||
validate_certs: false
|
||||
@@ -11,20 +11,21 @@
|
||||
api_token_secret: "{{ proxmox_token_secret }}"
|
||||
|
||||
cmode: "shell"
|
||||
vmid: 1040
|
||||
password: ansible-test
|
||||
hostname: "ansible-test"
|
||||
# ostemplate: 'main:vztmpl/debian-13-standard_13.1-2_amd64.tar.zst'
|
||||
password: "{{ lxc_root_password }}"
|
||||
hostname: "{{ lxc_hostname }}"
|
||||
ostemplate: 'main:vztmpl/debian-13-golden-image.tar.gz'
|
||||
memory: 2048
|
||||
cores: 5
|
||||
cores: 2
|
||||
state: present
|
||||
disk_volume:
|
||||
size: 2 # 2GB rootfs
|
||||
# This is minimal requirement for rootfs
|
||||
# It might be resized later
|
||||
size: 4 # 4GB rootfs
|
||||
# We put rootfs on fast local storage (NVMe SSD)
|
||||
storage: local
|
||||
pubkey: "{{ lookup('file', lookup('env', 'HOME') + '/.ssh/ansible_key.pub') }}"
|
||||
netif:
|
||||
net0: "name=eth0,gw=192.168.0.1,ip=192.168.0.40/24,bridge=vmbr0"
|
||||
net0: "name=eth0,gw=192.168.0.1,ip={{ lxc_ip_address }},bridge=vmbr0"
|
||||
|
||||
- name: Make sure the container has started
|
||||
become: false
|
||||
Reference in New Issue
Block a user