mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-12-09 02:45:17 +00:00
Why: - Ansible 2.20+ deprecates INJECT_FACTS_AS_VARS and direct usage of top-level ansible_* facts. - This change updates all affected roles and vars files to the new supported syntax. - Ensures compatibility with upcoming Ansible 2.24 removal of implicit fact injection. Conversation reference: https://chatgpt.com/share/692f639b-1380-800f-9f18-732f7108e9e2
27 lines
725 B
YAML
27 lines
725 B
YAML
- name: install wireguard for Arch
|
|
community.general.pacman:
|
|
name: wireguard-tools
|
|
state: present
|
|
when: ansible_facts['os_family'] == "Archlinux"
|
|
|
|
- name: install wireguard for Ubuntu
|
|
apt:
|
|
name: wireguard
|
|
state: present
|
|
when: ansible_facts['os_family'] == "Debian"
|
|
|
|
- name: create wireguard-ip.conf
|
|
copy:
|
|
src: "wireguard-ip.conf"
|
|
dest: /etc/sysctl.d/wireguard-ip.conf
|
|
owner: root
|
|
group: root
|
|
notify: reload sysctl configuration
|
|
|
|
- name: "deploy {{ WG0_CONF_DEST }}"
|
|
copy:
|
|
src: "{{ [inventory_dir, 'files', inventory_hostname, 'etc/wireguard/wg0.conf' ] | path_join }}"
|
|
dest: "{{ WG0_CONF_DEST }}"
|
|
owner: root
|
|
group: root
|
|
notify: restart wireguard |