1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_weechat.git synced 2024-07-06 20:38:53 +02:00

Adding save.directory option and dependabot

This commit is contained in:
L3D 2023-08-01 00:12:01 +02:00
parent 30c0110ed0
commit a9d585a8fa
Signed by: l3d
GPG key ID: CD08445BFF4313D1
7 changed files with 47 additions and 13 deletions

9
.github/dependabot.yml vendored Normal file
View file

@ -0,0 +1,9 @@
---
# See https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"

View file

@ -2,22 +2,22 @@
name: Ansible Lint check
# yamllint disable-line rule:truthy
on:
push:
branches: '*'
pull_request:
branches: '*'
on: [push, pull_request]
jobs:
build:
name: Ansible Lint
runs-on: ubuntu-latest
steps:
- name: 'checkout git repo'
uses: actions/checkout@v3
with:
lfs: true
submodules: false
fetch-depth: 0
- name: 'Lint Ansible Playbook'
uses: ansible/ansible-lint-action@v6
with:
targets: "."
path: "."

View file

@ -16,7 +16,7 @@ jobs:
uses: actions/checkout@v3
- name: 'release on galaxy'
uses: robertdebock/galaxy-action@1.2.0
uses: robertdebock/galaxy-action@1.2.1
with:
galaxy_api_key: ${{ secrets.galaxy_api_key }}
git_branch: 'main'

View file

@ -17,7 +17,7 @@ jobs:
uses: actions/checkout@v3
- name: 'Yamllint'
uses: karancode/yamllint-github-action@v2.0.0
uses: karancode/yamllint-github-action@v2.1.1
with:
yamllint_file_or_dir: '.'
yamllint_config_filepath: './.yamllint'

View file

@ -1,7 +1,7 @@
---
galaxy_info:
role_name: weechat
author: do1jlr
author: l3d
description: Install and optional configure weechat via ansible
license: "MIT"
min_ansible_version: '2.14'

View file

@ -32,13 +32,38 @@
- weechat__custom_gen_ssh_key_pair | bool
- ssh_key_pair.changed
- name: Add git repo to save.directory globally for root
become: true
community.general.git_config:
name: safe.directory
scope: global
value: "{{ weechat__home_directory }}/.weechat"
register: save_directory
- name: "Add git repo to save.directory globally for {{ weechat__user }}"
become: true
community.general.git_config:
file: "{{ weechat__home_directory }}/.gitconfig"
name: safe.directory
scope: file
value: "{{ weechat__home_directory }}/.weechat"
register: save_user_directory
- name: "Change git repo owner to {{ weechat__user }}"
become: true
ansible.builtin.file:
path: "{{ weechat__home_directory }}/.gitconfig"
recurse: false
owner: "{{ weechat__user }}"
changed_when: save_user_directory.changed | bool
- name: "Change git repo owner to root"
become: true
ansible.builtin.file:
path: "{{ weechat__home_directory }}/.weechat"
recurse: true
owner: "root"
changed_when: ssh_key_pair.changed
changed_when: ssh_key_pair.changed | bool or save_directory.changed | bool
when: not weechat__custom_private_repo | bool
- name: Clone or update private git repository
@ -73,5 +98,5 @@
path: "{{ weechat__home_directory }}/.weechat"
recurse: true
owner: "{{ weechat__user }}"
changed_when: ssh_key_pair.changed
changed_when: ssh_key_pair.changed | bool or save_directory.changed | bool
when: not weechat__custom_private_repo | bool

View file

@ -9,7 +9,7 @@ weechat_plugin_languages:
lua: 'lua'
# version management
playbook_version_number: 4222 # should be over ninethousand
playbook_version_number: 4223 # should be over ninethousand
playbook_version_path: 'role-weechat_roles-ansible_github.com.version'
weechat__debian_weechat_repo: "https://weechat.org/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} main"