Compare commits
No commits in common. "9afaf49651174b4203c2d641dc368dceb7583ad9" and "246178fa5da6adf5801f1706ddc719e19034773c" have entirely different histories.
9afaf49651
...
246178fa5d
1 changed files with 13 additions and 21 deletions
|
@ -1,11 +1,3 @@
|
|||
- 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
|
||||
template:
|
||||
dest: /etc/motd
|
||||
|
@ -41,25 +33,23 @@
|
|||
- rsync
|
||||
- vim
|
||||
- tmux
|
||||
update_cache: yes
|
||||
|
||||
# for base Debian the main interfaces file is just an include
|
||||
# we don’t want to template this file because it gets overwritten by proxmox
|
||||
# so just try removing anything that messes with our definitions in interfaces.d
|
||||
- name: Remove interface definitions added by installer
|
||||
when: not is_proxmox
|
||||
copy:
|
||||
dest: /etc/network/interfaces
|
||||
content: 'source /etc/network/interfaces.d/*'
|
||||
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
|
||||
when: is_proxmox
|
||||
lineinfile:
|
||||
path: /etc/network/interfaces
|
||||
regexp: '^(auto vmbr0|iface vmbr0|\t)' # our definitions start with four spaces instead of tab
|
||||
regexp: '^iface [^ ]* inet'
|
||||
state: absent
|
||||
notify: reload interfaces
|
||||
|
||||
- name: Include interfaces.d definitions
|
||||
lineinfile:
|
||||
path: /etc/network/interfaces
|
||||
line: 'source /etc/network/interfaces.d/*'
|
||||
notify: reload interfaces
|
||||
|
||||
- name: Set up interfaces
|
||||
template:
|
||||
dest: /etc/network/interfaces.d/ansible.intf
|
||||
|
@ -87,7 +77,7 @@
|
|||
|
||||
- name: Set up firewall
|
||||
include_tasks: firewall.yml
|
||||
when: not is_proxmox # proxmox has its own firewall configuration
|
||||
when: is_virtual or cluster_type != 'proxmox' # proxmox has its own firewall configuration
|
||||
|
||||
- name: Install automatic upgrade package
|
||||
package:
|
||||
|
@ -124,3 +114,5 @@
|
|||
name: sshd@mgmt
|
||||
enabled: yes
|
||||
notify: reboot
|
||||
|
||||
- meta: flush_handlers
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue