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

View file

@ -1,40 +1,41 @@
--- ---
- name: Create directory for versionscheck - name: Create directory for versionscheck
become: true become: true
file: ansible.builtin.file:
path: '/etc/ansible-version' path: '/etc/.ansible-version'
state: directory state: directory
mode: 0755 mode: 0755
when: submodules_versioncheck|bool
- name: check playbook version - name: check playbook version
become: true become: true
slurp: ansible.builtin.slurp:
src: "{{ playbook_version_path }}" src: "/etc/.ansible-version/{{ playbook_version_path }}"
register: playbook_version register: playbook_version
when: submodules_versioncheck|bool ignore_errors: true
ignore_errors: yes
failed_when: false failed_when: false
- name: Print remote role version - name: Print remote role version
debug: ansible.builtin.debug:
msg: "Remote role version: {{ playbook_version.content | default('Y3VycmVudGx5IG5vdCBkZXBsb3llZAo=') | b64decode | string }}" msg: "Remote role version: {{ playbook_version.content | default('Y3VycmVudGx5IG5vdCBkZXBsb3llZAo=') | b64decode | string }}"
when: submodules_versioncheck|bool
- name: Print locale role version - name: Print locale role version
debug: ansible.builtin.debug:
msg: "Local role version: '{{ playbook_version_number|string }}'." msg: "Local role version: '{{ playbook_version_number|string }}'."
when: submodules_versioncheck|bool
- name: Check if your version is outdated - 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!" msg: "Your ansible module has the version '{{ playbook_version_number }}' and is outdated. You need to update it!"
when: when:
- playbook_version.content|default("Mgo=")|b64decode|int - 1 >= playbook_version_number|int and submodules_versioncheck|bool - 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 - name: write new version to remote disk
become: true become: true
copy: ansible.builtin.copy:
content: "{{ playbook_version_number }}" content: "{{ playbook_version_number }}"
dest: "{{ playbook_version_path }}" dest: "/etc/.ansible-version/{{ playbook_version_path }}"
when: submodules_versioncheck|bool 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: roles:
- {role: ansible_version, tags: always, gather_facts: false} - {role: ansible_version, tags: always, gather_facts: false}
- name: run base setup roles - name: run do1jlr.base setup roles
hosts: localhost hosts: localhost
roles: roles:
- {role: base, tags: [default, packages, base]} - {role: do1jlr.base, tags: [default, packages, base]}
- {role: workstation_packages, tags: [default, workstation_packages, packages, setup]} - {role: workstation_packages, tags: [default, workstation_packages, packages, setup]}
- {role: ntp, tags: ntp} - {role: ntp, tags: ntp}
- {role: arch-fonts, tags: [font, fonts, arch-fonts]} - {role: arch-fonts, tags: [font, fonts, arch-fonts]}