1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_gopass.git synced 2024-09-14 20:06:42 +02:00

add requirements, improve lintin

This commit is contained in:
L3D 2023-10-28 17:20:20 +02:00
parent 4c54f6b249
commit 9f56809bc5
No known key found for this signature in database
GPG key ID: AD65B920933B4B20
7 changed files with 107 additions and 95 deletions

4
requirements.yml Normal file
View file

@ -0,0 +1,4 @@
---
collections:
- name: 'community.general'
version: ">=7.5.0,<=8.0.0"

View file

@ -3,54 +3,49 @@
become: true become: true
ansible.builtin.package: ansible.builtin.package:
name: "{{ item }}" name: "{{ item }}"
state: present state: 'present'
with_items: loop: "{{ gopass__required_packages }}"
- git
- gnupg
- rng-tools
- xsel
- xclip
- name: Install Gopass - name: Install Gopass
ansible.builtin.package: ansible.builtin.package:
name: "{{ item }}" name: "{{ item }}"
state: present state: 'present'
become: true become: true
with_items: loop:
- gopass - 'gopass'
- name: Install gopass-jsonapi for browser integration - name: Install gopass-jsonapi for browser integration
ansible.builtin.package: ansible.builtin.package:
name: "{{ item }}" name: "{{ item }}"
state: present state: 'present'
become: true become: true
with_items: loop:
- gopass-jsonapi - 'gopass-jsonapi'
when: gopass__install_jsonapi | bool when: gopass__install_jsonapi | bool
- name: Install gopass-hibp for haveibeenpwnd.com integration - name: Install gopass-hibp for haveibeenpwnd.com integration
ansible.builtin.package: ansible.builtin.package:
name: "{{ item }}" name: "{{ item }}"
state: present state: 'present'
become: true become: true
with_items: loop:
- gopass-hibp - 'gopass-hibp'
when: gopass__install_haveibeenpwnd | bool when: gopass__install_haveibeenpwnd | bool
- name: Install git-credential-gopass as git-credentials helper - name: Install git-credential-gopass as git-credentials helper
ansible.builtin.package: ansible.builtin.package:
name: "{{ item }}" name: "{{ item }}"
state: present state: 'present'
become: true become: true
with_items: loop:
- git-credential-gopass - 'git-credential-gopass'
when: gopass__install_git_credential | bool when: gopass__install_git_credential | bool
- name: Install zbar-tools for QR CodeReading using OTP Secrets - name: Install zbar-tools for QR CodeReading using OTP Secrets
ansible.builtin.package: ansible.builtin.package:
name: "{{ item }}" name: "{{ item }}"
state: present state: 'present'
become: true become: true
with_items: loop:
- zbar-tools - 'zbar-tools'
when: gopass__install_zbar_tools | bool when: gopass__install_zbar_tools | bool

View file

@ -1,58 +1,52 @@
--- ---
- name: Install requirements for gopass - name: Install requirements for gopass # noqa: H1901
become: true become: true
community.general.pacman: community.general.pacman:
name: "{{ item }}" name: "{{ item }}"
state: present state: 'present'
update_cache: true update_cache: true
with_items: loop: "{{ gopass__required_archlinux_packages }}"
- git
- gnupg
- rng-tools
- xsel
- xclip
- xorg-xclipboard
- name: Install Gopass - name: Install Gopass # noqa: H1901
community.general.pacman: community.general.pacman:
name: "{{ item }}" name: "{{ item }}"
state: present state: 'present'
become: true become: true
with_items: loop:
- gopass - 'gopass'
- name: Install gopass-jsonapi for browser integration - name: Install gopass-jsonapi for browser integration # noqa: H1901
community.general.pacman: community.general.pacman:
name: "{{ item }}" name: "{{ item }}"
state: present state: 'present'
become: true become: true
with_items: loop:
- gopass-jsonapi - 'gopass-jsonapi'
when: gopass__install_jsonapi | bool when: gopass__install_jsonapi | bool
- name: Install gopass-hibp for haveibeenpwnd.com integration - name: Install gopass-hibp for haveibeenpwnd.com integration # noqa: H1901
community.general.pacman: community.general.pacman:
name: "{{ item }}" name: "{{ item }}"
state: present state: 'present'
become: true become: true
with_items: loop:
- gopass-hibp - 'gopass-hibp'
when: gopass__install_haveibeenpwnd | bool when: gopass__install_haveibeenpwnd | bool
- name: Install git-credential-gopass as git-credentials helper - name: Install git-credential-gopass as git-credentials helper # noqa: H1901
community.general.pacman: community.general.pacman:
name: "{{ item }}" name: "{{ item }}"
state: present state: 'present'
become: true become: true
with_items: loop:
- git-credential-gopass - 'git-credential-gopass'
when: gopass__install_git_credential | bool when: gopass__install_git_credential | bool
- name: Install zbar-tools for QR CodeReading using OTP Secrets - name: Install zbar-tools for QR CodeReading using OTP Secrets # noqa: H1901
community.general.pacman: community.general.pacman:
name: "{{ item }}" name: "{{ item }}"
state: present state: 'present'
become: true become: true
with_items: loop:
- zbar-tools - 'zbar-tools'
when: gopass__install_zbar_tools | bool when: gopass__install_zbar_tools | bool

View file

@ -9,12 +9,7 @@
ansible.builtin.apt: ansible.builtin.apt:
name: "{{ item }}" name: "{{ item }}"
state: present state: present
with_items: loop: "{{ gopass__required_debian_packages }}"
- git
- gnupg2
- rng-tools
- xsel
- xclip
- name: Adding Gopass Package Repository - name: Adding Gopass Package Repository
when: gopass__add_apt_repo | bool when: gopass__add_apt_repo | bool
@ -23,9 +18,9 @@
ansible.builtin.get_url: ansible.builtin.get_url:
url: https://packages.gopass.pw/repos/gopass/gopass-archive-keyring.gpg url: https://packages.gopass.pw/repos/gopass/gopass-archive-keyring.gpg
dest: "{{ gopass__keyring }}" dest: "{{ gopass__keyring }}"
owner: root owner: 'root'
group: root group: 'root'
mode: 0644 mode: '0644'
become: true become: true
- name: Add Gopass repository source - name: Add Gopass repository source
@ -33,9 +28,9 @@
ansible.builtin.template: ansible.builtin.template:
src: "templates/apt.gopass.sources.j2" src: "templates/apt.gopass.sources.j2"
dest: '/etc/apt/sources.list.d/gopass.sources' dest: '/etc/apt/sources.list.d/gopass.sources'
mode: 0644 mode: '0644'
group: root group: 'root'
owner: root owner: 'root'
notify: Trigger apt update notify: Trigger apt update
- name: Trigger Handlers - name: Trigger Handlers
@ -44,44 +39,44 @@
- name: Install Gopass and Gopass archive keyring - name: Install Gopass and Gopass archive keyring
ansible.builtin.apt: ansible.builtin.apt:
name: "{{ item }}" name: "{{ item }}"
state: present state: 'present'
become: true become: true
with_items: loop:
- gopass-archive-keyring - 'gopass-archive-keyring'
- gopass - 'gopass'
- name: Install gopass-jsonapi for browser integration - name: Install gopass-jsonapi for browser integration
ansible.builtin.apt: ansible.builtin.apt:
name: "{{ item }}" name: "{{ item }}"
state: present state: 'present'
become: true become: true
with_items: loop:
- gopass-jsonapi - 'gopass-jsonapi'
when: gopass__install_jsonapi | bool when: gopass__install_jsonapi | bool
- name: Install gopass-hibp for haveibeenpwnd.com integration - name: Install gopass-hibp for haveibeenpwnd.com integration
ansible.builtin.apt: ansible.builtin.apt:
name: "{{ item }}" name: "{{ item }}"
state: present state: 'present'
become: true become: true
with_items: loop:
- gopass-hibp - 'gopass-hibp'
when: gopass__install_haveibeenpwnd | bool when: gopass__install_haveibeenpwnd | bool
- name: Install git-credential-gopass as git-credentials helper - name: Install git-credential-gopass as git-credentials helper
ansible.builtin.apt: ansible.builtin.apt:
name: "{{ item }}" name: "{{ item }}"
state: present state: 'present'
become: true become: true
with_items: loop:
- git-credential-gopass - 'git-credential-gopass'
when: gopass__install_git_credential | bool when: gopass__install_git_credential | bool
- name: Install zbar-tools for QR CodeReading using OTP Secrets - name: Install zbar-tools for QR CodeReading using OTP Secrets
ansible.builtin.apt: ansible.builtin.apt:
name: "{{ item }}" name: "{{ item }}"
state: present state: 'present'
become: true become: true
with_items: loop:
- zbar-tools - 'zbar-tools'
when: gopass__install_zbar_tools | bool when: gopass__install_zbar_tools | bool

View file

@ -1,14 +1,9 @@
--- ---
- name: Run optional versionscheck - name: Run optional versionscheck
ansible.builtin.include_tasks: versioncheck.yml ansible.builtin.include_tasks:
file: versioncheck.yml
when: submodules_versioncheck | bool when: submodules_versioncheck | bool
- name: Install GoPass Packages - name: Install GoPass Packages
ansible.builtin.include_tasks: "{{ lookup('ansible.builtin.first_found', gopass_install) }}" ansible.builtin.include_tasks:
vars: file: "{{ lookup('ansible.builtin.first_found', gopass_install) }}"
gopass_install:
files:
- "install-on-{{ ansible_os_family | lower }}.yml"
- 'install-gopass-default.yml'
paths:
- 'tasks/gopass-install'

View file

@ -16,15 +16,14 @@
src: "/etc/.ansible-version/{{ playbook_version_path }}" src: "/etc/.ansible-version/{{ playbook_version_path }}"
register: playbook_version register: playbook_version
when: submodules_versioncheck | bool when: submodules_versioncheck | bool
ignore_errors: true
failed_when: false failed_when: false
- name: Print remote role version - name: Print remote role version # noqa: H500
ansible.builtin.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 when: submodules_versioncheck | bool
- name: Print locale role version - name: Print locale role version # noqa: H500
ansible.builtin.debug: ansible.builtin.debug:
msg: "Local role version: '{{ playbook_version_number | string }}'." msg: "Local role version: '{{ playbook_version_number | string }}'."
when: submodules_versioncheck | bool when: submodules_versioncheck | bool
@ -42,3 +41,4 @@
dest: "/etc/.ansible-version/{{ playbook_version_path }}" dest: "/etc/.ansible-version/{{ playbook_version_path }}"
mode: '0644' mode: '0644'
when: submodules_versioncheck | bool when: submodules_versioncheck | bool
tags: skip_ansible_lint_template-instead-of-copy

View file

@ -1,5 +1,34 @@
--- ---
gopass__keyring: /usr/share/keyrings/gopass-archive-keyring.gpg gopass__keyring: '/usr/share/keyrings/gopass-archive-keyring.gpg'
# versionscheck gopass_install:
playbook_version_number: 03 # should be a integer files:
- "install-on-{{ ansible_os_family | lower }}.yml"
- 'install-gopass-default.yml'
paths:
- 'tasks/gopass-install'
gopass__required_packages:
- git
- gnupg
- rng-tools
- xsel
- xclip
gopass__required_debian_packages:
- git
- gnupg2
- rng-tools
- xsel
- xclip
gopass__required_archlinux_packages:
- git
- gnupg
- rng-tools
- xsel
- xclip
- xorg-xclipboard
# simple versionscheck
playbook_version_number: 04
playbook_version_path: 'l3d.gopass.version' playbook_version_path: 'l3d.gopass.version'