1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_weechat.git synced 2024-08-16 13:09:48 +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 name: Ansible Lint check
# yamllint disable-line rule:truthy # yamllint disable-line rule:truthy
on: on: [push, pull_request]
push:
branches: '*'
pull_request:
branches: '*'
jobs: jobs:
build: build:
name: Ansible Lint
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: 'checkout git repo' - name: 'checkout git repo'
uses: actions/checkout@v3 uses: actions/checkout@v3
with:
lfs: true
submodules: false
fetch-depth: 0
- name: 'Lint Ansible Playbook' - name: 'Lint Ansible Playbook'
uses: ansible/ansible-lint-action@v6 uses: ansible/ansible-lint-action@v6
with: with:
targets: "." path: "."

View file

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

View file

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

View file

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

View file

@ -32,13 +32,38 @@
- weechat__custom_gen_ssh_key_pair | bool - weechat__custom_gen_ssh_key_pair | bool
- ssh_key_pair.changed - 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" - name: "Change git repo owner to root"
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: "root" 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 when: not weechat__custom_private_repo | bool
- name: Clone or update private git repository - name: Clone or update private git repository
@ -73,5 +98,5 @@
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 changed_when: ssh_key_pair.changed | bool or save_directory.changed | bool
when: not weechat__custom_private_repo | bool when: not weechat__custom_private_repo | bool

View file

@ -9,7 +9,7 @@ weechat_plugin_languages:
lua: 'lua' lua: 'lua'
# version management # 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' 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"