Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/migration ansible lint v6 #794

Merged
merged 6 commits into from Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-ansible.yml
Expand Up @@ -129,7 +129,7 @@ jobs:
run: |
sudo apt update
sudo apt-get install python3-setuptools
python3 -m pip install ansible ansible-lint==5.4.0 yamllint --user
python3 -m pip install ansible ansible-lint yamllint --user
- name: run yamllint
env:
CI: true
Expand Down
140 changes: 140 additions & 0 deletions ansible/.ansible-lint-ignore
@@ -0,0 +1,140 @@
centos.yml yaml[comments]
roles/actionlint/tasks/main.yml var-naming[no-role-prefix]
roles/actionlint/tasks/main.yml yaml[comments]
roles/actionlint/tasks/main.yml var-naming[no-role-prefix]
roles/actionlint/tasks/main.yml key-order[task]
roles/actionlint/tasks/main.yml name[missing]
roles/actionlint/tasks/main.yml risky-file-permissions
roles/actionlint/tasks/main.yml risky-file-permissions
roles/anyenv/meta/main.yml yaml[comments]
roles/anyenv/tasks/main.yml no-free-form
roles/anyenv/tasks/main.yml command-instead-of-shell
roles/anyenv/tasks/main.yml var-naming[no-role-prefix]
roles/anyenv/tasks/main.yml command-instead-of-shell
roles/anyenv/tasks/main.yml no-changed-when
roles/anyenv/tasks/main.yml var-naming[no-role-prefix]
roles/anyenv/tasks/main.yml command-instead-of-shell
roles/anyenv/tasks/main.yml no-changed-when
roles/anyenv/tasks/main.yml command-instead-of-shell
roles/anyenv/tasks/main.yml var-naming[no-role-prefix]
roles/anyenv/tasks/main.yml command-instead-of-shell
roles/anyenv/tasks/main.yml no-changed-when
roles/awscli/tasks/main.yml var-naming[no-role-prefix]
roles/awscli/tasks/main.yml var-naming[no-role-prefix]
roles/awscli/tasks/main.yml key-order[task]
roles/awscli/tasks/main.yml name[missing]
roles/awscli/tasks/main.yml risky-file-permissions
roles/bat/tasks/debian.yml risky-file-permissions
roles/bat/tasks/main.yml var-naming[no-role-prefix]
roles/bat/tasks/main.yml var-naming[no-role-prefix]
roles/bat/tasks/main.yml key-order[task]
roles/bat/tasks/main.yml name[missing]
roles/bat/tasks/redhat.yml risky-file-permissions
roles/delta/meta/main.yml yaml[comments]
roles/delta/tasks/install-glibc.yml var-naming[no-role-prefix]
roles/delta/tasks/install-glibc.yml key-order[task]
roles/delta/tasks/install-glibc.yml name[missing]
roles/delta/tasks/install-glibc.yml risky-file-permissions
roles/delta/tasks/install-glibc.yml no-free-form
roles/delta/tasks/main.yml var-naming[no-role-prefix]
roles/delta/tasks/main.yml var-naming[no-role-prefix]
roles/delta/tasks/main.yml key-order[task]
roles/delta/tasks/main.yml name[missing]
roles/delta/tasks/main.yml risky-file-permissions
roles/deploy/vars/main.yml jinja[spacing]
roles/deploy/vars/main.yml jinja[spacing]
roles/deploy/vars/main.yml jinja[spacing]
roles/direnv/tasks/main.yml var-naming[no-role-prefix]
roles/direnv/tasks/main.yml var-naming[no-role-prefix]
roles/direnv/tasks/main.yml key-order[task]
roles/direnv/tasks/main.yml name[missing]
roles/docker-compose/tasks/main.yml var-naming[no-role-prefix]
roles/docker-compose/tasks/main.yml var-naming[no-role-prefix]
roles/docker-compose/tasks/main.yml key-order[task]
roles/docker-compose/tasks/main.yml name[missing]
roles/docker/tasks/main.yml var-naming[no-role-prefix]
roles/docker/tasks/main.yml var-naming[no-role-prefix]
roles/docker/tasks/main.yml key-order[task]
roles/docker/tasks/main.yml name[missing]
roles/embulk/tasks/main.yml no-free-form
roles/embulk/tasks/main.yml var-naming[no-role-prefix]
roles/embulk/tasks/main.yml var-naming[no-role-prefix]
roles/fillin/tasks/main.yml var-naming[no-role-prefix]
roles/fillin/tasks/main.yml var-naming[no-role-prefix]
roles/fillin/tasks/main.yml key-order[task]
roles/fillin/tasks/main.yml name[missing]
roles/fillin/tasks/main.yml risky-file-permissions
roles/git/tasks/main.yml var-naming[no-role-prefix]
roles/git/tasks/main.yml var-naming[no-role-prefix]
roles/git/tasks/main.yml yaml[comments]
roles/git/tasks/main.yml key-order[task]
roles/git/tasks/main.yml name[missing]
roles/git/tasks/main.yml risky-file-permissions
roles/git/tasks/main.yml no-free-form
roles/git/tasks/redhat.yml yaml[comments]
roles/git/vars/main.yml jinja[spacing]
roles/jo/tasks/main.yml var-naming[no-role-prefix]
roles/jo/tasks/main.yml var-naming[no-role-prefix]
roles/jo/tasks/main.yml key-order[task]
roles/jo/tasks/main.yml name[missing]
roles/jo/tasks/main.yml risky-file-permissions
roles/jo/tasks/main.yml no-free-form
roles/jq/tasks/main.yml var-naming[no-role-prefix]
roles/jq/tasks/main.yml var-naming[no-role-prefix]
roles/jq/tasks/main.yml key-order[task]
roles/jq/tasks/main.yml name[missing]
roles/notofont/tasks/main.yml risky-file-permissions
roles/notofont/tasks/main.yml var-naming[no-role-prefix]
roles/packages/tasks/redhat.yml no-free-form
roles/packages/tasks/redhat.yml no-free-form
roles/peco/tasks/main.yml var-naming[no-role-prefix]
roles/peco/tasks/main.yml var-naming[no-role-prefix]
roles/peco/tasks/main.yml key-order[task]
roles/peco/tasks/main.yml name[missing]
roles/peco/tasks/main.yml risky-file-permissions
roles/powerline/tasks/main.yml no-free-form
roles/powerline/tasks/main.yml command-instead-of-shell
roles/powerline/tasks/main.yml yaml[comments]
roles/q/tasks/main.yml no-free-form
roles/reviewdog/tasks/main.yml var-naming[no-role-prefix]
roles/reviewdog/tasks/main.yml yaml[comments]
roles/reviewdog/tasks/main.yml var-naming[no-role-prefix]
roles/reviewdog/tasks/main.yml key-order[task]
roles/reviewdog/tasks/main.yml name[missing]
roles/reviewdog/tasks/main.yml risky-file-permissions
roles/reviewdog/tasks/main.yml risky-file-permissions
roles/samba/handlers/main.yml no-free-form
roles/samba/tasks/main.yml no-free-form
roles/samba/tasks/main.yml no-free-form
roles/samba/tasks/main.yml no-free-form
roles/terraform/tasks/main.yml var-naming[no-role-prefix]
roles/terraform/tasks/main.yml var-naming[no-role-prefix]
roles/terraform/tasks/main.yml key-order[task]
roles/terraform/tasks/main.yml name[missing]
roles/terraform/tasks/main.yml risky-file-permissions
roles/tmux/tasks/main.yml var-naming[no-role-prefix]
roles/tmux/tasks/main.yml var-naming[no-role-prefix]
roles/tmux/tasks/main.yml key-order[task]
roles/tmux/tasks/main.yml name[missing]
roles/tmux/tasks/main.yml risky-file-permissions
roles/tmux/tasks/main.yml no-free-form
roles/vim-plugins/meta/main.yml yaml[comments]
roles/vim-plugins/tasks/main.yml yaml[comments]
roles/vim8/meta/main.yml yaml[comments]
roles/vim8/tasks/main.yml var-naming[no-role-prefix]
roles/vim8/tasks/main.yml var-naming[no-role-prefix]
roles/vim8/tasks/main.yml var-naming[no-role-prefix]
roles/vim8/tasks/main.yml key-order[task]
roles/vim8/tasks/main.yml name[missing]
roles/zsh/meta/main.yml yaml[comments]
roles/zsh/tasks/main.yml no-free-form
roles/zsh/tasks/main.yml no-free-form
roles/zsh/tasks/source.yml var-naming[no-role-prefix]
roles/zsh/tasks/source.yml var-naming[no-role-prefix]
roles/zsh/tasks/source.yml key-order[task]
roles/zsh/tasks/source.yml name[missing]
roles/zsh/tasks/source.yml risky-file-permissions
roles/zsh/tasks/source.yml command-instead-of-module
roles/zsh/tasks/source.yml no-free-form
roles/zsh/tasks/source.yml no-free-form
ubuntu.yml yaml[comments]
12 changes: 7 additions & 5 deletions ansible/centos.yml
@@ -1,10 +1,11 @@
---
- hosts: localhost
- name: Play for CentOS(root)
hosts: localhost
# strategy: debug
vars_files:
- common_vars.yml
- versions_vars.yml
become: yes
become: true
roles:
- { role: packages, tags: [common, init, tool, dev] }
- { role: language-dependencies, tags: [anyenv] }
Expand All @@ -29,16 +30,17 @@
- { role: q, tags: [q, tool] }
- { role: nginx, tags: [nginx, dev] }
- { role: notofont, tags: [notofont, init] }
- { role: by_pip, tags: [by_pip, tool] } # cheat, mycli
- { role: by_pip, tags: [by_pip, tool] } # cheat, mycli
- { role: actionlint, tags: [actionlint, tool] }
- { role: reviewdog, tags: [reviewdog, tool] }

- hosts: localhost
- name: Play for CentOS(user)
hosts: localhost
# strategy: debug
vars_files:
- common_vars.yml
- versions_vars.yml
become: no
become: false
become_user: "{{ user }}"
roles:
- { role: deploy, tags: deploy }
Expand Down
10 changes: 6 additions & 4 deletions ansible/codespace.yml
@@ -1,10 +1,11 @@
---
- hosts: localhost
- name: Play for Codespace(root)
hosts: localhost
# strategy: debug
vars_files:
- common_vars.yml
- versions_vars.yml
become: yes
become: true
roles:
- { role: common, tags: [common, init, tool] }
- { role: peco, tags: [peco, init] }
Expand All @@ -17,12 +18,13 @@
- { role: actionlint, tags: [actionlint, tool] }
- { role: reviewdog, tags: [reviewdog, tool] }

- hosts: localhost
- name: Play for Codespace(User)
hosts: localhost
# strategy: debug
vars_files:
- common_vars.yml
- versions_vars.yml
become: no
become: false
become_user: "{{ user }}"
roles:
- { role: deploy, tags: deploy }
7 changes: 4 additions & 3 deletions ansible/mac.yml
@@ -1,12 +1,13 @@
---
- hosts: local
- name: Play for Mac
hosts: local
vars_files:
- common_vars.yml
- versions_vars.yml
become: no
become: false
become_user: "{{ user }}"
roles:
- { role: brew, tags: brew }
- { role: anyenv, tags: anyenv }
- { role: actionlint, tags: actionlint}
- { role: actionlint, tags: actionlint }
- { role: reviewdog, tags: reviewdog }
56 changes: 26 additions & 30 deletions ansible/roles/actionlint/tasks/main.yml
@@ -1,45 +1,41 @@
---
- name: exist actionlint # noqa command-instead-of-shell
shell: command -v actionlint
- name: Exist actionlint # noqa command-instead-of-shell
ansible.builtin.shell: command -v actionlint
environment:
PATH: "/usr/local/bin:{{ ansible_env.PATH }}"
PATH: /usr/local/bin:{{ ansible_env.PATH }}
register: exist_actionlint
changed_when: false
ignore_errors: true

- name: get actionlint version
shell: "actionlint --version | head -n 1"
- name: Get actionlint version
ansible.builtin.shell: actionlint --version | head -n 1
environment:
PATH: "/usr/local/bin:{{ ansible_env.PATH }}"
PATH: /usr/local/bin:{{ ansible_env.PATH }}
register: version_in_actionlint
changed_when: false
ignore_errors: true
when:
exist_actionlint.rc == 0
when: exist_actionlint.rc == 0

- block:
- name: get tar.gz
get_url:
url: "{{ actionlint.src.darwin }}"
dest: "/tmp/{{ actionlint.tgz }}"
when: "ansible_os_family == 'Darwin'"
- name: Get tar.gz
ansible.builtin.get_url:
url: "{{ actionlint.src.darwin }}"
dest: /tmp/{{ actionlint.tgz }}
when: ansible_os_family == 'Darwin'

- name: get tar.gz
get_url:
url: "{{ actionlint.src.linux }}"
dest: "/tmp/{{ actionlint.tgz }}"
when: "ansible_os_family != 'Darwin'"
- name: Get tar.gz
ansible.builtin.get_url:
url: "{{ actionlint.src.linux }}"
dest: /tmp/{{ actionlint.tgz }}
when: ansible_os_family != 'Darwin'

- name: unarchive zip
unarchive:
src: /tmp/{{ actionlint.tgz }}
dest: /tmp/
copy: no
- name: Unarchive zip
ansible.builtin.unarchive:
src: /tmp/{{ actionlint.tgz }}
dest: /tmp/
copy: false

- name: install
changed_when: true
command: mv /tmp/actionlint /usr/local/bin/actionlint

when:
exist_actionlint.rc != 0
or ( version_in_actionlint is defined and version_in_actionlint.stdout.find(actionlint_version) == -1 )
- name: Install
changed_when: true
ansible.builtin.command: mv /tmp/actionlint /usr/local/bin/actionlint
when: exist_actionlint.rc != 0 or ( version_in_actionlint is defined and version_in_actionlint.stdout.find(actionlint_version) == -1 )
2 changes: 1 addition & 1 deletion ansible/roles/anyenv/meta/main.yml
@@ -1,3 +1,3 @@
---
dependencies: # noqa meta-no-info
dependencies: # noqa meta-no-info
- role: deploy