Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
KSZK
Ansible
Roles
Base
Commits
597f35bf
Commit
597f35bf
authored
Sep 16, 2021
by
rlacko
💬
Browse files
Add netplan config and traceroute package
parent
c50bb4a9
Changes
6
Hide whitespace changes
Inline
Side-by-side
defaults/main.yml
View file @
597f35bf
...
...
@@ -23,3 +23,19 @@ users:
# passwordless_sudo: yes
# # https://docs.ansible.com/ansible/latest/collections/ansible/posix/authorized_key_module.html#examples
# keys_url: https://git.sch.bme.hu/xy.keys
# netplan:
# network:
# ethernets:
# ens192:
# dhcp4: no
# addresses:
# - 152.66.208.666/24
# nameservers:
# search: [sch.bme.hu]
# addresses: [152.66.208.1, 8.8.8.8]
# gateway4: 152.66.208.254
# ens224:
# dhcp4: no
# addresses:
# - 192.168.1.254/24
tasks/main.yml
View file @
597f35bf
...
...
@@ -34,3 +34,7 @@
-
name
:
Fix multipath UUID VMWare errors
include_tasks
:
multipath.yaml
-
name
:
Update netplan config
include_tasks
:
netplan.yaml
when
:
netplan is defined
tasks/netplan.yaml
0 → 100644
View file @
597f35bf
---
-
name
:
Disable cloud init networking
template
:
src
:
etc/cloud/cloud.cfg.d/99-disable-network-config.cfg.j2
dest
:
/etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
mode
:
0644
-
name
:
Add netplan network config
template
:
src
:
etc/netplan/01-netcfg.yaml.j2
dest
:
/etc/netplan/01-netcfg.yaml
mode
:
0644
register
:
netplan_config
-
name
:
Remove old netplan config
ansible.builtin.file
:
path
:
/etc/netplan/50-cloud-init.yaml
state
:
absent
when
:
netplan_config.changed
-
name
:
Apply Netplan Configuration
command
:
netplan apply
when
:
netplan_config.changed
tasks/packages.yml
View file @
597f35bf
...
...
@@ -19,6 +19,7 @@
-
strace
-
tcpdump
-
xxd
-
traceroute
# Editors
-
nano
...
...
templates/etc/cloud/cloud.cfg.d/99-disable-network-config.cfg.j2
0 → 100644
View file @
597f35bf
#
# !!!
# {{ ansible_managed }}
# !!!
# Disable cloudinit network config
network: {config: disabled}
templates/etc/netplan/01-netcfg.yaml.j2
0 → 100644
View file @
597f35bf
#
# !!!
# {{ ansible_managed }}
# !!!
network:
version: 2
renderer: networkd
ethernets:
{{ netplan['network']['ethernets']|to_nice_yaml|indent(4, true) }}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment