Compare commits
3 commits
246178fa5d
...
9afaf49651
Author | SHA1 | Date | |
---|---|---|---|
9afaf49651 | |||
04c5be85c5 | |||
e28bb50a9e |
1 changed files with 19 additions and 11 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
- block:
|
||||||
|
- name: Determine if this is a Proxmox host
|
||||||
|
stat:
|
||||||
|
path: /etc/pve
|
||||||
|
register: stat_pve
|
||||||
|
- set_fact:
|
||||||
|
is_proxmox: "{{ stat_pve.stat.exists and stat_pve.stat.isdir }}"
|
||||||
|
|
||||||
- name: Configure MOTD
|
- name: Configure MOTD
|
||||||
template:
|
template:
|
||||||
dest: /etc/motd
|
dest: /etc/motd
|
||||||
|
@ -33,21 +41,23 @@
|
||||||
- rsync
|
- rsync
|
||||||
- vim
|
- vim
|
||||||
- tmux
|
- tmux
|
||||||
update_cache: yes
|
|
||||||
|
|
||||||
# we don’t want to template this file because it gets overwritten by proxmox
|
# for base Debian the main interfaces file is just an include
|
||||||
# so just try removing anything that messes with our definitions in interfaces.d
|
|
||||||
- name: Remove interface definitions added by installer
|
- name: Remove interface definitions added by installer
|
||||||
lineinfile:
|
when: not is_proxmox
|
||||||
path: /etc/network/interfaces
|
copy:
|
||||||
regexp: '^iface [^ ]* inet'
|
dest: /etc/network/interfaces
|
||||||
state: absent
|
content: 'source /etc/network/interfaces.d/*'
|
||||||
notify: reload interfaces
|
notify: reload interfaces
|
||||||
|
|
||||||
|
# for Proxmox the main interfaces file will define bridges
|
||||||
|
# here we just remove the vmbr0 definition created by installer to preserve idempotency
|
||||||
- name: Include interfaces.d definitions
|
- name: Include interfaces.d definitions
|
||||||
|
when: is_proxmox
|
||||||
lineinfile:
|
lineinfile:
|
||||||
path: /etc/network/interfaces
|
path: /etc/network/interfaces
|
||||||
line: 'source /etc/network/interfaces.d/*'
|
regexp: '^(auto vmbr0|iface vmbr0|\t)' # our definitions start with four spaces instead of tab
|
||||||
|
state: absent
|
||||||
notify: reload interfaces
|
notify: reload interfaces
|
||||||
|
|
||||||
- name: Set up interfaces
|
- name: Set up interfaces
|
||||||
|
@ -77,7 +87,7 @@
|
||||||
|
|
||||||
- name: Set up firewall
|
- name: Set up firewall
|
||||||
include_tasks: firewall.yml
|
include_tasks: firewall.yml
|
||||||
when: is_virtual or cluster_type != 'proxmox' # proxmox has its own firewall configuration
|
when: not is_proxmox # proxmox has its own firewall configuration
|
||||||
|
|
||||||
- name: Install automatic upgrade package
|
- name: Install automatic upgrade package
|
||||||
package:
|
package:
|
||||||
|
@ -114,5 +124,3 @@
|
||||||
name: sshd@mgmt
|
name: sshd@mgmt
|
||||||
enabled: yes
|
enabled: yes
|
||||||
notify: reboot
|
notify: reboot
|
||||||
|
|
||||||
- meta: flush_handlers
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue