diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..dde6f4a --- /dev/null +++ b/.github/dependabot.yml @@ -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" diff --git a/.github/workflows/ansible-linting-check.yml b/.github/workflows/ansible-linting-check.yml index 150e908..5c55ca6 100644 --- a/.github/workflows/ansible-linting-check.yml +++ b/.github/workflows/ansible-linting-check.yml @@ -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: "." diff --git a/.github/workflows/galaxy.yml b/.github/workflows/galaxy.yml index adcecbd..39fa2be 100644 --- a/.github/workflows/galaxy.yml +++ b/.github/workflows/galaxy.yml @@ -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' diff --git a/.github/workflows/yamllint.yaml b/.github/workflows/yamllint.yaml index d744e9c..361b111 100644 --- a/.github/workflows/yamllint.yaml +++ b/.github/workflows/yamllint.yaml @@ -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' diff --git a/meta/main.yml b/meta/main.yml index 84d343a..ad959ce 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -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' diff --git a/tasks/configure_custom_config.yml b/tasks/configure_custom_config.yml index 43d93c7..52c9e84 100644 --- a/tasks/configure_custom_config.yml +++ b/tasks/configure_custom_config.yml @@ -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 diff --git a/vars/main.yml b/vars/main.yml index 63ae78b..2286d66 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -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"