add networking
This commit is contained in:
parent
39dbc76dca
commit
98b208923d
1
.gitignore
vendored
Executable file
1
.gitignore
vendored
Executable file
@ -0,0 +1 @@
|
|||||||
|
vault.yml
|
2
README.md
Executable file
2
README.md
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
- Create API token "ansible"
|
||||||
|
- Make sure privilege seperation is unchecked
|
0
files/powertop.service
Normal file → Executable file
0
files/powertop.service
Normal file → Executable file
5
main.yml
5
main.yml
@ -5,11 +5,12 @@
|
|||||||
|
|
||||||
vars_files:
|
vars_files:
|
||||||
- vault.yml
|
- vault.yml
|
||||||
|
- vars
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- import_tasks: tasks/setup.yml
|
- import_tasks: tasks/setup.yml
|
||||||
tags: ['setup']
|
tags: ['setup']
|
||||||
|
|
||||||
# - import_tasks: tasks/vms.yml
|
- import_tasks: tasks/vms.yml
|
||||||
# tags: ['vms']
|
tags: ['vms']
|
||||||
|
|
||||||
|
47
tasks/setup.yml
Normal file → Executable file
47
tasks/setup.yml
Normal file → Executable file
@ -1,3 +1,39 @@
|
|||||||
|
# DOES NOT WORK RN
|
||||||
|
- name: Configure network interfaces
|
||||||
|
community.general.interfaces_file:
|
||||||
|
dest: /etc/network/interfaces
|
||||||
|
state: present
|
||||||
|
iface:
|
||||||
|
- name: lo
|
||||||
|
inet: loopback
|
||||||
|
auto: true
|
||||||
|
- name: eno1
|
||||||
|
inet: manual
|
||||||
|
- name: eno2
|
||||||
|
inet: manual
|
||||||
|
- name: vmbr0
|
||||||
|
inet: static
|
||||||
|
auto: true
|
||||||
|
options:
|
||||||
|
- address 192.168.0.11/24
|
||||||
|
- gateway 192.168.0.1
|
||||||
|
- bridge-ports eno1
|
||||||
|
- bridge-stp off
|
||||||
|
- bridge-fd 0
|
||||||
|
- name: vmbr1
|
||||||
|
inet: manual
|
||||||
|
auto: true
|
||||||
|
options:
|
||||||
|
- bridge-ports eno2
|
||||||
|
- bridge-stp off
|
||||||
|
- bridge-fd 0
|
||||||
|
register: interfaces
|
||||||
|
|
||||||
|
- name: reload networking if interfaces changed
|
||||||
|
ansible.builtin.systemd_service:
|
||||||
|
state: started
|
||||||
|
name: networking
|
||||||
|
when: interfaces.changed
|
||||||
|
|
||||||
- name: install programs
|
- name: install programs
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
@ -6,9 +42,18 @@
|
|||||||
- libguestfs-tools # for virt-customize
|
- libguestfs-tools # for virt-customize
|
||||||
- neovim
|
- neovim
|
||||||
- powertop
|
- powertop
|
||||||
|
- python3-pip
|
||||||
- tmux
|
- tmux
|
||||||
update_cache: true
|
update_cache: true
|
||||||
upgrade: true
|
|
||||||
|
- name: Ignore PEP 668 because it's silly.
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /usr/lib/python3.11/EXTERNALLY-MANAGED
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Install proxmoxer python package (required for ansible)
|
||||||
|
ansible.builtin.pip:
|
||||||
|
name: proxmoxer
|
||||||
|
|
||||||
- name: create powertop service
|
- name: create powertop service
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
|
23
tasks/vms.yml
Normal file → Executable file
23
tasks/vms.yml
Normal file → Executable file
@ -2,15 +2,18 @@
|
|||||||
- name: get latest cloud-init image
|
- name: get latest cloud-init image
|
||||||
ansible.builtin.get_url:
|
ansible.builtin.get_url:
|
||||||
url: https://cdimage.debian.org/images/cloud/trixie/daily/latest/debian-13-generic-amd64-daily.qcow2
|
url: https://cdimage.debian.org/images/cloud/trixie/daily/latest/debian-13-generic-amd64-daily.qcow2
|
||||||
dest: /var/lib/vz/template/iso/
|
dest: /var/lib/vz/template/iso/debian-13-generic-amd64-daily.qcow2
|
||||||
|
|
||||||
#- name: opnsense
|
- name: opnsense
|
||||||
# community.general.proxmox_kvm:
|
community.general.proxmox_kvm:
|
||||||
# node: "{{ proxmox_node }}"
|
name: opnsense
|
||||||
# vmid: "{{ opnsense_id }}"
|
node: "{{ proxmox_node }}"
|
||||||
# api_user: "{{ proxmox_api_user }}"
|
vmid: "{{ opnsense_id }}"
|
||||||
# api_token_id: "{{ proxmox_token_id }}"
|
api_user: "{{ proxmox_api_user }}"
|
||||||
# api_token_secret: "{{ proxmox_secret }}"
|
api_token_id: "{{ proxmox_token_id }}"
|
||||||
# api_host: "{{ proxmox_host }}"
|
api_token_secret: "{{ proxmox_secret }}"
|
||||||
# state: started
|
api_host: "{{ ansible_ssh_host }}"
|
||||||
|
state: started
|
||||||
|
net0: bridge=vmbr0
|
||||||
|
net1: bridge=vmbr1
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user