1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_weechat.git synced 2024-08-16 13:09:48 +02:00

Merge pull request #8 from roles-ansible/lint

improve linting and update meta info
This commit is contained in:
L3D 2023-03-01 22:20:48 +01:00 committed by GitHub
commit 30c0110ed0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 88 additions and 244 deletions

View file

@ -1,18 +0,0 @@
---
name: Ansible check archlinux:latest
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 'checkout git repo'
uses: actions/checkout@v3
- name: 'ansible check with archlinux:latest'
uses: roles-ansible/check-ansible-archlinux-latest-action@master
with:
targets: "./"

View file

@ -1,18 +0,0 @@
---
name: Ansible check centos:latest
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 'checkout git repo'
uses: actions/checkout@v3
- name: 'ansible check with ubuntu:latest'
uses: roles-ansible/check-ansible-centos-latest-action@master
with:
targets: "./"

View file

@ -1,18 +0,0 @@
---
name: Ansible check debian:sid
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 'checkout git repo'
uses: actions/checkout@v3
- name: 'ansible check with debian:sid'
uses: roles-ansible/check-ansible-debian-sid-action@master
with:
targets: "./"

View file

@ -1,18 +0,0 @@
---
name: Ansible check debian:stretch
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 'checkout git repo'
uses: actions/checkout@v3
- name: 'ansible check with debian:stretch'
uses: roles-ansible/check-ansible-debian-stretch-action@master
with:
targets: "./"

View file

@ -1,18 +0,0 @@
---
name: Ansible check fedora:31
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 'checkout git repo'
uses: actions/checkout@v3
- name: 'ansible check with fedora:31'
uses: roles-ansible/check-ansible-fedora-31-action@master
with:
targets: "./"

View file

@ -1,18 +0,0 @@
---
name: Ansible check fedora:32
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 'checkout git repo'
uses: actions/checkout@v3
- name: 'ansible check with fedora:32'
uses: roles-ansible/check-ansible-fedora-32-action@master
with:
targets: "./"

View file

@ -1,18 +0,0 @@
---
name: Ansible check fedora:33
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 'checkout git repo'
uses: actions/checkout@v3
- name: 'ansible check with fedora:33'
uses: roles-ansible/check-ansible-fedora-33-action@master
with:
targets: "./"

View file

@ -1,18 +0,0 @@
---
name: Ansible check fedora:latest
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 'checkout git repo'
uses: actions/checkout@v3
- name: 'ansible check with fedora:latest'
uses: roles-ansible/check-ansible-fedora-latest-action@master
with:
targets: "./"

View file

@ -10,6 +10,7 @@ on:
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:

View file

@ -1,18 +0,0 @@
---
name: Ansible check ubuntu:bionic
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 'checkout git repo'
uses: actions/checkout@v3
- name: 'ansible check with ubuntu:bionic'
uses: roles-ansible/check-ansible-ubuntu-bionic-action@master
with:
targets: "./"

View file

@ -1,18 +0,0 @@
---
name: Ansible check ubuntu:trusty
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 'checkout git repo'
uses: actions/checkout@v3
- name: ansible check with ubuntu:trusty
uses: roles-ansible/check-ansible-ubuntu-trusty-action@master
with:
targets: "./"

View file

@ -1,4 +1,5 @@
[![Ansible Galaxy](https://raw.githubusercontent.com/chaos-bodensee/role_weechat/master/.github/galaxy.svg?sanitize=true)](https://galaxy.ansible.com/do1jlr/weechat) [![MIT License](https://raw.githubusercontent.com/chaos-bodensee/role_weechat/master/.github/license.svg?sanitize=true)](https://github.com/chaos-bodensee/role_weechat/blob/master/LICENSE) [![Ansible Galaxy](https://raw.githubusercontent.com/roles-ansible/ansible_role_weechat/main/.github/galaxy.svg)](https://galaxy.ansible.com/do1jlr/weechat)
[![MIT License](https://raw.githubusercontent.com/roles-ansible/ansible_role_weechat/main/.github/license.svg?sanitize=true)](https://github.com/roles-ansible/ansible_role_weechat/blob/main/LICENSE)
ansible weechat role ansible weechat role
========================== ==========================

View file

@ -1,5 +1,5 @@
--- ---
- name: systemctl restart weechat.service - name: Run systemctl restart weechat.service
become: true become: true
ansible.builtin.systemd: ansible.builtin.systemd:
state: restarted state: restarted

View file

@ -4,18 +4,19 @@ galaxy_info:
author: do1jlr author: do1jlr
description: Install and optional configure weechat via ansible description: Install and optional configure weechat via ansible
license: "MIT" license: "MIT"
min_ansible_version: 2.11 min_ansible_version: '2.14'
github_branch: main
platforms: platforms:
- name: Archlinux - name: 'ArchLinux'
versions: all versions: ['all']
- name: Debian - name: 'Debian'
versions: all versions: ['all']
- name: Ubuntu - name: 'Ubuntu'
versions: all versions: ['all']
- name: Fedora - name: 'Fedora'
versions: all versions: ['all']
galaxy_tags: galaxy_tags:
- weechat - weechat
- irc - irc
- chat
- textmessages
dependencies: [] dependencies: []

View file

@ -1,5 +1,5 @@
--- ---
- name: create ssh key pair (if needed) - name: Create ssh key pair (if needed)
become: true become: true
community.crypto.openssh_keypair: community.crypto.openssh_keypair:
path: "{{ weechat__home_directory }}/.ssh/id_ed25519" path: "{{ weechat__home_directory }}/.ssh/id_ed25519"
@ -8,7 +8,7 @@
register: ssh_key_pair register: ssh_key_pair
when: weechat__custom_gen_ssh_key_pair | bool when: weechat__custom_gen_ssh_key_pair | bool
- name: print ssh public key to user - name: Print ssh public key to user
ansible.builtin.pause: ansible.builtin.pause:
prompt: | prompt: |
We generated a new ssh key pair for you. We generated a new ssh key pair for you.
@ -32,36 +32,46 @@
- weechat__custom_gen_ssh_key_pair | bool - weechat__custom_gen_ssh_key_pair | bool
- ssh_key_pair.changed - ssh_key_pair.changed
- name: clone or update private git repository - name: "Change git repo owner to root"
become: true become: true
ansible.builtin.file:
path: "{{ weechat__home_directory }}/.weechat"
recurse: true
owner: "root"
changed_when: ssh_key_pair.changed
when: not weechat__custom_private_repo | bool
- name: Clone or update private git repository
become: true
when: not weechat__custom_private_repo | bool
block: block:
- name: try to download/update git repo - name: Try to download/update git repo
ansible.builtin.git: ansible.builtin.git:
repo: "{{ weechat__custom_private_repo }}" repo: "{{ weechat__custom_private_repo }}"
dest: "{{ weechat__home_directory }}/.weechat" dest: "{{ weechat__home_directory }}/.weechat"
version: "{{ weechat__custom_config.version | default ('main') }}" version: "{{ weechat__custom_config.version | default('main') }}"
accept_hostkey: true accept_hostkey: true
update: true update: true
ssh_opts: "-i {{ weechat__home_directory }}/.ssh/id_ed25519" ssh_opts: "-i {{ weechat__home_directory }}/.ssh/id_ed25519"
rescue: rescue:
- name: wait until you fixed remote git issues - name: Wait until you fixed remote git issues
ansible.builtin.pause: ansible.builtin.pause:
prompt: "Please fix the issue with your git repository and try again" prompt: "Please fix the issue with your git repository and try again"
- name: try to download/update git repo again - name: Try to download/update git repo again
ansible.builtin.git: ansible.builtin.git:
repo: "{{ weechat__custom_private_repo }}" repo: "{{ weechat__custom_private_repo }}"
dest: "{{ weechat__home_directory }}/.weechat" dest: "{{ weechat__home_directory }}/.weechat"
version: "{{ weechat__custom_config.version | default ('main') }}" version: "{{ weechat__custom_config.version | default('main') }}"
accept_hostkey: true accept_hostkey: true
update: true update: true
ssh_opts: "-i {{ weechat__home_directory }}/.ssh/id_ed25519" ssh_opts: "-i {{ weechat__home_directory }}/.ssh/id_ed25519"
when: not weechat__custom_private_repo | bool
- name: "change git repo owner to {{ weechat__user }}" - name: "Change git repo owner to {{ weechat__user }}"
become: true become: true
ansible.builtin.file: ansible.builtin.file:
path: "{{ weechat__home_directory }}/.weechat" path: "{{ weechat__home_directory }}/.weechat"
recurse: true recurse: true
owner: "{{ weechat__user }}" owner: "{{ weechat__user }}"
changed_when: ssh_key_pair.changed
when: not weechat__custom_private_repo | bool when: not weechat__custom_private_repo | bool

View file

@ -1,5 +1,5 @@
--- ---
- name: create weechat directory - name: Create weechat directory
become: true become: true
ansible.builtin.file: ansible.builtin.file:
path: "{{ weechat__home_directory }}/.weechat" path: "{{ weechat__home_directory }}/.weechat"
@ -7,7 +7,7 @@
owner: "{{ weechat__user }}" owner: "{{ weechat__user }}"
mode: "0750" mode: "0750"
- name: create weechat plugins directory - name: Create weechat plugins directory
become: true become: true
ansible.builtin.file: ansible.builtin.file:
path: "{{ weechat__home_directory }}/.weechat/{{ item.value }}/autoload" path: "{{ weechat__home_directory }}/.weechat/{{ item.value }}/autoload"
@ -16,16 +16,16 @@
mode: "0750" mode: "0750"
with_dict: "{{ weechat_plugin_languages }}" with_dict: "{{ weechat_plugin_languages }}"
- name: download weechat plugins - name: Download weechat plugins
ansible.builtin.get_url: ansible.builtin.get_url:
url: 'https://weechat.org/files/scripts/{{ item }}' url: 'https://weechat.org/files/scripts/{{ item }}'
dest: "{{ weechat__home_directory }}/.weechat/{{ weechat_plugin_languages[item.split('.',1)[-1]] }}/{{ item }}" dest: "{{ weechat__home_directory }}/.weechat/{{ weechat_plugin_languages[item.split('.', 1)[-1]] }}/{{ item }}"
mode: '0644' mode: '0644'
with_items: '{{ weechat__plugins }}' with_items: '{{ weechat__plugins }}'
- name: symlinking plugins to autoload - name: Symlinking plugins to autoload
ansible.builtin.file: ansible.builtin.file:
src: "{{ weechat__home_directory }}/.weechat/{{ weechat_plugin_languages[item.split('.',1)[-1]] }}/{{ item }}" src: "{{ weechat__home_directory }}/.weechat/{{ weechat_plugin_languages[item.split('.', 1)[-1]] }}/{{ item }}"
dest: "{{ weechat__home_directory }}/.weechat/{{ weechat_plugin_languages[item.split('.',1)[-1]] }}/autoload/{{ item }}" dest: "{{ weechat__home_directory }}/.weechat/{{ weechat_plugin_languages[item.split('.', 1)[-1]] }}/autoload/{{ item }}"
state: link state: link
with_items: '{{ weechat__plugins }}' with_items: '{{ weechat__plugins }}'

View file

@ -1,5 +1,5 @@
--- ---
- name: install weechat if available - name: Install weechat if available
become: true become: true
ansible.builtin.package: ansible.builtin.package:
name: name:

View file

@ -1,8 +1,18 @@
--- ---
- name: install apt-transport-https - name: Update apt cache
become: true become: true
ansible.builtin.apt: ansible.builtin.apt:
name: apt-transport-https cache_valid_time: 3600
update_cache: true
when:
- ansible_pkg_mgr == "apt"
- name: Install apt-transport-https
become: true
ansible.builtin.apt:
name:
- apt-transport-https
- gpg
state: present state: present
- name: Add weechat repository gpg-key - name: Add weechat repository gpg-key
@ -12,21 +22,21 @@
id: "{{ weechat__gpg_id }}" id: "{{ weechat__gpg_id }}"
state: present state: present
- name: add weechat repo - name: Add weechat repo
become: true become: true
ansible.builtin.apt_repository: ansible.builtin.apt_repository:
repo: "deb {{ weechat__debian_weechat_repo }}" repo: "deb {{ weechat__debian_weechat_repo }}"
state: present state: present
update_cache: true update_cache: true
- name: add weechat repo-src - name: Add weechat repo-src
become: true become: true
ansible.builtin.apt_repository: ansible.builtin.apt_repository:
repo: "deb-src {{ weechat__debian_weechat_repo }}" repo: "deb-src {{ weechat__debian_weechat_repo }}"
state: present state: present
update_cache: true update_cache: true
- name: install recomended weechat packages - name: Install recomended weechat packages
become: true become: true
ansible.builtin.apt: ansible.builtin.apt:
name: name:

View file

@ -1,5 +1,5 @@
--- ---
- name: install weechat if available - name: Install weechat if available
become: true become: true
ansible.builtin.package: ansible.builtin.package:
name: name:

View file

@ -1,20 +1,20 @@
--- ---
- name: perform optinal versionscheck - name: Perform optinal versionscheck
ansible.builtin.include_tasks: versioncheck.yml ansible.builtin.include_tasks: versioncheck.yml
when: submodules_versioncheck|bool when: submodules_versioncheck|bool
- name: install weechat - name: Install weechat
ansible.builtin.include_tasks: "install-{{ ansible_os_family|lower }}.yml" ansible.builtin.include_tasks: "install-{{ ansible_os_family | lower }}.yml"
when: weechat__install | bool when: weechat__install | bool
- name: deploy weechat__configuration - name: Deploy weechat__configuration
ansible.builtin.include_tasks: configure_custom_config.yml ansible.builtin.include_tasks: configure_custom_config.yml
when: weechat__use_custom_config | bool when: weechat__use_custom_config | bool
- name: install requirements for weechat__plugins - name: Install requirements for weechat__plugins
ansible.builtin.include_tasks: configure_plugins.yml ansible.builtin.include_tasks: configure_plugins.yml
when: weechat__install_plugins | bool when: weechat__install_plugins | bool
- name: setup weechat__autostart - name: Setup weechat__autostart
ansible.builtin.include_tasks: setup_autostart.yml ansible.builtin.include_tasks: setup_autostart.yml
when: weechat__autostart | bool when: weechat__autostart | bool

View file

@ -1,12 +1,12 @@
--- ---
- name: install tmux to launch weechat - name: Install tmux to launch weechat
become: true become: true
ansible.builtin.package: ansible.builtin.package:
name: tmux name: tmux
state: present state: present
when: weechat__install | bool when: weechat__install | bool
- name: copy systemd service for weechat - name: Copy systemd service for weechat
become: true become: true
ansible.builtin.template: ansible.builtin.template:
src: templates/weechat.service src: templates/weechat.service
@ -14,13 +14,13 @@
owner: root owner: root
group: root group: root
mode: '0644' mode: '0644'
notify: systemctl restart weechat.service notify: Run systemctl restart weechat.service
- name: enable weechat.service - name: Enable weechat.service
become: true become: true
ansible.builtin.systemd: ansible.builtin.systemd:
enabled: true enabled: true
state: started state: started
name: weechat.service name: weechat.service
daemon_reload: true daemon_reload: true
notify: systemctl restart weechat.service notify: Run systemctl restart weechat.service

View file

@ -8,37 +8,38 @@
path: '/etc/.ansible-version' path: '/etc/.ansible-version'
state: directory state: directory
mode: 0755 mode: 0755
when: submodules_versioncheck|bool when: submodules_versioncheck | bool
- name: check playbook version - name: Check playbook version
become: true become: true
ansible.builtin.slurp: ansible.builtin.slurp:
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 ignore_errors: true
failed_when: false failed_when: false
- name: Print remote role version - name: Print remote role version
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
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
- name: Check if your version is outdated - name: Check if your version is outdated
ansible.builtin.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: write new version to remote disk - name: Write new version to remote disk
become: true become: true
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ playbook_version_number }}" content: "{{ playbook_version_number }}"
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,15 +1,15 @@
--- ---
# weechat plugin languages # weechat plugin languages
weechat_plugin_languages: weechat_plugin_languages:
pl: perl pl: 'perl'
scm: guile scm: 'guile'
js: javascript js: 'javascript'
py: python py: 'python'
rb: ruby rb: 'ruby'
lua: lua lua: 'lua'
# version management # version management
playbook_version_number: 4221 # should be over ninethousand playbook_version_number: 4222 # should be over ninethousand
playbook_version_path: 'role-weechat_roles-ansible_github.com.version' playbook_version_path: 'role-weechat_roles-ansible_github.com.version'
weechat__debian_weechat_repo: "https://weechat.org/{{ ansible_distribution|lower }} {{ ansible_distribution_release }} main" weechat__debian_weechat_repo: "https://weechat.org/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} main"