Skip to content

Commit

Permalink
prepare_host.yaml: new apt pkg style and tab fixed
Browse files Browse the repository at this point in the history
- New apt multipackage style

- Tabulation in `templates/interfaces.j2` and in `/etc/lvm/lvm.conf`
  line fixed: in Debian buster tabulation is used to indent this config
  files by default.
  • Loading branch information
zolfariot committed Mar 31, 2020
1 parent 0181f31 commit 1ca84a3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
2 changes: 1 addition & 1 deletion MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ On the hosts:
|`roles/service` | **YES** | **YES** | NO | Changes in Ansible built-in `apt` module. |
|`roles/ssh_server` | **YES** | **YES** | NO | `lxc_ssh.py` --> `ssh_lxc.py`. |
|`roles/ca` | **YES** | ReadNote | NO | Changes in Ansible built-in `apt` module. Needs update of `ca_manager` to [1] to work. |
|`prepare_host.yaml` | **YES** | NO | NO | Install `python3` and `python3-lxc` instead of version 2. |
|`prepare_host.yaml` | **YES** | **YES** | NO | Debian stretch --> buster and Python 2 --> 3 |
|`roles/ldap` | NO | NO | NO | |
|`roles/nginx` | NO | NO | NO | |
|`roles/projects` | NO | NO | NO | |
Expand Down
25 changes: 11 additions & 14 deletions prepare_host.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@
tasks:
- name: install lxc related packages
apt:
name: "{{ item }}"
pkg:
- lxc
- python3
- python3-lxc
state: present
update_cache: yes
cache_valid_time: 3600
with_items:
- lxc
- python3
- python3-lxc

- name: install common lxc filesystem support
apt:
Expand All @@ -24,13 +23,12 @@

- name: install network bridge utilities
apt:
name: "{{ item }}"
pkg:
- bridge-utils
- vlan
state: present
update_cache: yes
cache_valid_time: 3600
with_items:
- bridge-utils
- vlan
notify: restart networking
# We should fix this bug. We really should. It's a bug.
# Bridge-utils requires a complete system reboot to enable the new bridge.
Expand All @@ -43,19 +41,18 @@

- name: install utilities
apt:
name: "{{ item }}"
pkg:
- vim
- htop
state: present
update_cache: yes
cache_valid_time: 3600
with_items:
- vim
- htop

- name: enable lvm wipe signature
lineinfile:
dest: /etc/lvm/lvm.conf
state: present
line: " wipe_signatures_when_zeroing_new_lvs = 0"
line: " wipe_signatures_when_zeroing_new_lvs = 0"
regexp: '^\s*.+wipe_signatures_when_zeroing_new_lvs = '
notify: restart lvm
handlers:
Expand Down
8 changes: 4 additions & 4 deletions templates/interfaces.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ iface lo inet loopback
# The primary network interface
auto br0
iface br0 inet manual
bridge_ports {{ ansible_default_ipv4.alias }}.{{ virtual_machine_vlan }}
bridge_fd 1
bridge_ports {{ ansible_default_ipv4.alias }}.{{ virtual_machine_vlan }}
bridge_fd 1

auto {{ ansible_default_ipv4.alias }}
iface {{ ansible_default_ipv4.alias }} inet static
address {{ ansible_default_ipv4.address }}
gateway {{ hostvars | ip_from_inventory('management_gateway') }}
netmask 255.255.255.0
gateway {{ hostvars | ip_from_inventory('management_gateway') }}
netmask 255.255.255.0
vlan-raw-device {{ ansible_default_ipv4.alias }}

0 comments on commit 1ca84a3

Please sign in to comment.