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

Merge branch 'main' of github.com:DO1JLR/ansible_linux_desktop_setup into main

This commit is contained in:
L3D 2021-03-17 15:45:38 +01:00
commit 464b2ecb4a
6 changed files with 39 additions and 34 deletions

View file

@ -1,16 +1,18 @@
---
- 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:
name:
become: true
ansible.builtin.pacman:
name:
- openvpn
- bridge-utils
- easy-rsa
@ -18,9 +20,9 @@
when: ansible_os_family == 'Archlinux'
- name: Install OpenVPN all
become: yes
package:
name:
become: true
ansible.builtin.package:
name:
- openvpn
- bridge-utils
- easy-rsa
@ -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'

@ -1 +1 @@
Subproject commit 048b4c9cacc9adf53b4fcd730be86b0d1d37956d
Subproject commit 02be50bbe15f53ecdea2d7e98268b97292590098

@ -1 +1 @@
Subproject commit a7415b576d9229f388cb05097f856c6a9ed265e1
Subproject commit 445e76ea5ced8b265b3ce3a9720cb65c6378136f

View file

@ -4,10 +4,10 @@
roles:
- {role: ansible_version, tags: always, gather_facts: false}
- name: run base setup roles
- name: run do1jlr.base setup roles
hosts: localhost
roles:
- {role: base, tags: [default, packages, base]}
- {role: do1jlr.base, tags: [default, packages, base]}
- {role: workstation_packages, tags: [default, workstation_packages, packages, setup]}
- {role: ntp, tags: ntp}
- {role: arch-fonts, tags: [font, fonts, arch-fonts]}