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

huge commit, updating role to ansible 2.11

+ update to ansible 2.11
+ improved linting
+ delete travis
+ increase version
+ update meta data
This commit is contained in:
L3D 2021-05-27 14:14:13 +02:00
parent 05fafe3375
commit eaa4a63cae
Signed by: l3d
GPG key ID: CD08445BFF4313D1
31 changed files with 237 additions and 175 deletions

1
.github/FUNDING.yml vendored
View file

@ -1,3 +1,4 @@
---
# These are supported funding model platforms
github: [do1jlr]

View file

@ -1,5 +1,7 @@
---
name: Ansible check archlinux:latest
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:

View file

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

View file

@ -1,5 +1,7 @@
---
name: Ansible check debian:buster
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:

View file

@ -1,5 +1,7 @@
---
name: Ansible check debian:latest
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:

View file

@ -1,5 +1,7 @@
---
name: Ansible check debian:sid
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:

View file

@ -1,5 +1,7 @@
---
name: Ansible check debian:stable
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:

View file

@ -1,5 +1,7 @@
---
name: Ansible check debian:stretch
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:

View file

@ -1,5 +1,7 @@
---
name: Ansible check fedora:31
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:

View file

@ -1,5 +1,7 @@
---
name: Ansible check fedora:32
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:

View file

@ -1,5 +1,7 @@
---
name: Ansible check fedora:33
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:

View file

@ -1,5 +1,7 @@
---
name: Ansible check fedora:latest
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:

View file

@ -1,6 +1,14 @@
---
name: Ansible Lint check
on: [push, pull_request]
# yamllint disable-line rule:truthy
on:
push:
branches: '*'
pull_request:
branches: '*'
schedule:
- cron: '42 6 * */1 *'
jobs:
build:

View file

@ -1,5 +1,7 @@
---
name: Ansible check ubuntu:bionic
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:

View file

@ -1,16 +0,0 @@
name: Ansible check ubuntu:eoan
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: ansible check with ubuntu:eoan
uses: roles-ansible/check-ansible-ubuntu-eoan-action@master
with:
targets: "./"

View file

@ -1,5 +1,7 @@
---
name: Ansible check ubuntu:latest
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:

View file

@ -1,5 +1,7 @@
---
name: Ansible check ubuntu:trusty
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:

20
.github/workflows/galaxy.yml vendored Normal file
View file

@ -0,0 +1,20 @@
---
name: Galaxy release
# yamllint disable-line rule:truthy
on:
push:
branches: ['main']
release:
types: ['created']
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: galaxy
uses: robertdebock/galaxy-action@1.1.0
with:
galaxy_api_key: ${{ secrets.galaxy_api_key }}

24
.github/workflows/yamllint.yaml vendored Normal file
View file

@ -0,0 +1,24 @@
---
name: 'Yamllint GitHub Actions'
# yamllint disable-line rule:truthy
on:
push:
branches: '*'
pull_request:
branches: '*'
schedule:
- cron: '23 6 * */1 *'
jobs:
yamllint:
name: 'Yamllint'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@master
- name: 'Yamllint'
uses: karancode/yamllint-github-action@master
with:
yamllint_file_or_dir: '.'
yamllint_config_filepath: './.yamllint'

View file

@ -1,29 +0,0 @@
---
# OS Details
os: linux
language: python
python: '3.8'
cache:
pip: true
# Install ansible and ansible-lint
install:
- pip install ansible
- pip install ansible-lint
# testing galaxy install and ansible lint
# more advanced testing is currently handled with
# github actions. The gh-actions for our test are there:
# https://github.com/roles-ansible and are tagged
# with 'github-actions' --> https://github.com/search?q=topic%3Agithub-actions+org%3Aroles-ansible&type=Repositories
script:
- ansible-galaxy install do1jlr.ranger
- ansible-lint .
- echo -e "\n\n\n\n\nWe use github actions for more detailed tests.\n\nMore details about that in our github repo at:\nhttps://github.com/chaos-bodensee/role-weechat/actions\n\n\n\n\n\n"
notifications:
email:
on_success: never
on_failure: always
webhooks: https://galaxy.ansible.com/api/v1/notifications/

8
.yamllint Normal file
View file

@ -0,0 +1,8 @@
---
extends: default
rules:
# 160 chars should be enough, but don't fail if a line is longer
line-length:
max: 160
level: warning

View file

@ -1,7 +1,7 @@
---
- name: systemctl restart weechat.service
become: true
systemd:
ansible.builtin.systemd:
state: restarted
name: weechat.service
daemon_reload: yes
daemon_reload: true

View file

@ -1,24 +1,21 @@
---
dependencies: []
galaxy_info:
author: L3D
description: Install WeeChat
license: "license (MIT)"
role_name: weechat
author: do1jlr
description: Install and optional configure weechat via ansible
license: "MIT"
min_ansible_version: 2.11
github_branch: main
platforms:
- name: Archlinux
versions: all
- name: Debian
versions:
- all
- name: ArchLinux
versions:
- all
- name: Fedora
versions:
- all
versions: all
- name: Ubuntu
versions:
- all
min_ansible_version: 2.8
versions: all
- name: Fedora
versions: all
galaxy_tags:
- system
- weechat
- irc
dependencies: []

View file

@ -2,7 +2,7 @@
- name: create ssh key pair (if needed)
become_user: "{{ weechat.user }}"
become: true
openssh_keypair:
community.cryptop.openssh_keypair:
path: "{{ weechat.home_directory }}/.ssh/id_ed25519"
type: ed25519
owner: "{{ weechat.user }}"
@ -10,7 +10,7 @@
when: weechat.custom_config.gen_ssh_key_pair | bool
- name: print ssh public key to user
pause:
ansible.builtin.pause:
prompt: |
We generated a new ssh key pair for you.
Please use the following public key as deployment key
@ -38,22 +38,22 @@
become: true
block:
- name: try to download/update git repo
git:
ansible.builtin.git:
repo: "{{ weechat.custom_config.private_repo }}"
dest: "{{ weechat.home_directory }}/.weechat"
version: master
accept_hostkey: yes
update: yes
accept_hostkey: true
update: true
rescue:
- name: wait until you fixed remote git issues
pause:
prompt: "Please fix the issue with your git repository and try again"
- name: try to download/update git repo again
git:
ansible.builtin.git:
repo: "{{ weechat.custom_config.private_repo }}"
dest: "{{ weechat.home_directory }}/.weechat"
version: master
accept_hostkey: yes
update: yes
accept_hostkey: true
update: true
when: not weechat.custom_config.private_repo | bool

View file

@ -1,6 +1,7 @@
---
- name: install weechat if available
package:
become: true
ansible.builtin.package:
name:
- weechat
state: present

View file

@ -1,34 +1,34 @@
---
- name: install apt-transport-https
become: true
apt:
ansible.builtin.apt:
name: apt-transport-https
state: present
- name: Add weechat repository gpg-key
become: true
apt_key:
ansible.builtin.apt_key:
keyserver: 'keys.openpgp.org'
id: "{{ weechat.gpg_id }}"
state: present
- name: add weechat repo
become: true
apt_repository:
ansible.builtin.apt_repository:
repo: "deb {{ weechat__debian_weechat_repo }}"
state: present
update_cache: true
- name: add weechat repo-src
become: true
apt_repository:
ansible.builtin.apt_repository:
repo: "deb-src {{ weechat__debian_weechat_repo }}"
state: present
update_cache: true
- name: install recomended weechat packages
become: true
apt:
ansible.builtin.apt:
name:
- weechat-curses
- weechat-plugins

View file

@ -1,6 +1,7 @@
---
- name: install weechat if available
package:
become: true
ansible.builtin.package:
name:
- weechat
state: present

View file

@ -3,17 +3,22 @@
set_fact:
weechat: "{{ _weechat | combine(weechat, recursive=True) }}"
- include_tasks: versioncheck.yml
- name: perform optinal versionscheck
ansible.builtin.include_tasks: versioncheck.yml
when: submodules_versioncheck|bool
- include_tasks: "install-{{ ansible_os_family|lower }}.yml"
- name: install weechat
ansible.builtin.include_tasks: "install-{{ ansible_os_family|lower }}.yml"
when: weechat.install | bool
- include_tasks: configure_custom_config.yml
- name: deploy weechat configuration
ansible.builtin.include_tasks: configure_custom_config.yml
when: weechat.use_custom_config | bool
- include_tasks: configure_plugins.yml
- name: install requirements for weechat plugins
ansible.builtin.include_tasks: configure_plugins.yml
when: weechat.install_plugins | bool
- include_tasks: setup_autostart.yml
- name: setup weechat autostart
ansible.builtin.include_tasks: setup_autostart.yml
when: weechat.autostart | bool

View file

@ -1,14 +1,14 @@
---
- name: install tmux to launch weechat
become: true
package:
ansible.builtin.package:
name: tmux
state: present
when: weechat.install | bool
- name: copy systemd service for weechat
become: true
template:
ansible.builtin.template:
src: templates/weechat.service
dest: /etc/systemd/system/weechat.service
owner: root
@ -18,7 +18,7 @@
- name: enable weechat.service
become: true
systemd:
ansible.builtin.systemd:
enabled: true
state: started
name: weechat.service

View file

@ -1,7 +1,10 @@
---
# Copyright (c) 2021 L3D <l3d@c3woc.de>
# this file is released with the MIT license.
# License: https://github.com/roles-ansible/ansible_role_template/blob/main/LICENSE
- name: Create directory for versionscheck
become: true
file:
ansible.builtin.file:
path: '/etc/.ansible-version'
state: directory
mode: 0755
@ -9,37 +12,32 @@
- name: check playbook version
become: true
slurp:
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
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: "/etc/.ansible-version/{{ playbook_version_path }}"
mode: '0644'

View file

@ -9,7 +9,7 @@ weechat_plugin_languages:
lua: lua
# version management
playbook_version_number: 4099 # should be over ninethousand
playbook_version_number: 4199 # should be over ninethousand
playbook_version_path: 'role-weechat_roles-ansible_github.com.version'
# default values