1
0
Fork 0
mirror of https://github.com/DO1JLR/ansible_linux_desktop_setup.git synced 2024-09-14 19:54:51 +02:00

update openvpn

This commit is contained in:
L3D 2021-03-17 00:43:57 +01:00
parent 1fbcc6bdfd
commit 9dd5bc1973
Signed by: l3d
GPG key ID: CD08445BFF4313D1
3 changed files with 35 additions and 30 deletions

View file

@ -1,15 +1,17 @@
---
- name: perform versionscheck
ansible.builtin.include_tasks: versioncheck.yml
- name: Run the equivalent of "pacman -Syu" as a separate step
become: yes
pacman:
update_cache: yes
upgrade: yes
become: true
ansible.builtin.pacman:
update_cache: true
upgrade: true
when: ansible_os_family == 'Archlinux'
- name: Install OpenVPN for ArchLinux
become: yes
pacman:
become: true
ansible.builtin.pacman:
name:
- openvpn
- bridge-utils
@ -18,8 +20,8 @@
when: ansible_os_family == 'Archlinux'
- name: Install OpenVPN all
become: yes
package:
become: true
ansible.builtin.package:
name:
- openvpn
- bridge-utils
@ -28,14 +30,13 @@
when: ansible_os_family != 'Archlinux'
- name: Add the tun module
become: yes
modprobe:
become: true
community.general.modprobe:
name: tun
state: present
- name: Add the bridge module
become: yes
modprobe:
become: true
community.general.modprobe:
name: bridge
state: present

View file

@ -1,40 +1,41 @@
---
- name: Create directory for versionscheck
become: true
file:
path: '/etc/ansible-version'
ansible.builtin.file:
path: '/etc/.ansible-version'
state: directory
mode: 0755
when: submodules_versioncheck|bool
- name: check playbook version
become: true
slurp:
src: "{{ playbook_version_path }}"
ansible.builtin.slurp:
src: "/etc/.ansible-version/{{ playbook_version_path }}"
register: playbook_version
when: submodules_versioncheck|bool
ignore_errors: yes
ignore_errors: true
failed_when: false
- name: Print remote role version
debug:
ansible.builtin.debug:
msg: "Remote role version: {{ playbook_version.content | default('Y3VycmVudGx5IG5vdCBkZXBsb3llZAo=') | b64decode | string }}"
when: submodules_versioncheck|bool
- name: Print locale role version
debug:
ansible.builtin.debug:
msg: "Local role version: '{{ playbook_version_number|string }}'."
when: submodules_versioncheck|bool
- name: Check if your version is outdated
fail:
ansible.builtin.fail:
msg: "Your ansible module has the version '{{ playbook_version_number }}' and is outdated. You need to update it!"
when:
- playbook_version.content|default("Mgo=")|b64decode|int - 1 >= playbook_version_number|int and submodules_versioncheck|bool
- name: check if '/etc/ansible-version/' is empty
ansible.builtin.find:
paths: '/etc/ansible-version/'
register: filesFound
- name: write new version to remote disk
become: true
copy:
ansible.builtin.copy:
content: "{{ playbook_version_number }}"
dest: "{{ playbook_version_path }}"
when: submodules_versioncheck|bool
dest: "/etc/.ansible-version/{{ playbook_version_path }}"
mode: '0644'

View file

@ -0,0 +1,3 @@
---
playbook_version_number: 1337
playbook_version_path: 'openvpn__random__4FWvXf4WPrjttnKnVPMzkXTtNVkz4Tg.version