From e86374973a44bf211e726f7291c0191a16c932ad Mon Sep 17 00:00:00 2001 From: Jannik Beyerstedt Date: Tue, 3 Dec 2024 09:48:05 +0100 Subject: [PATCH] [TIDY] fix ansible-lint issues --- meta/main.yml | 2 +- tasks/devel-Archlinux.yml | 10 ++++++---- tasks/devel-Darwin.yml | 10 ++++++---- tasks/devel-Debian.yml | 10 ++++++---- tasks/devel.yml | 20 +++++++++++--------- tasks/usersettings.yml | 10 ++++++++-- tasks/usersetup-Archlinux.yml | 9 +++++---- tasks/usersetup-Centos.yml | 9 +++++---- tasks/usersetup-Darwin.yml | 5 +++-- tasks/usersetup-Debian.yml | 9 +++++---- tasks/usersetup-FreeBSD.yml | 9 +++++---- tasks/usertools-FreeBSD.yml | 1 - tasks/usertools.yml | 2 +- 13 files changed, 62 insertions(+), 44 deletions(-) diff --git a/meta/main.yml b/meta/main.yml index 2a0ba32..c946889 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -4,7 +4,7 @@ galaxy_info: # issue_tracker_url: http://example.com/issue/tracker license: Apache2.0 - min_ansible_version: 2.4 + min_ansible_version: "2.4" platforms: - name: Debian diff --git a/tasks/devel-Archlinux.yml b/tasks/devel-Archlinux.yml index b42a818..9a30d98 100644 --- a/tasks/devel-Archlinux.yml +++ b/tasks/devel-Archlinux.yml @@ -13,7 +13,7 @@ # Install Visual Studio Code and Set Basic Configuration - name: VSCode - Basics - when: user_vscode == true + when: user_vscode block: - name: VSCode - Basics - Install become: true @@ -37,14 +37,16 @@ ansible.builtin.file: path: "{{ ansible_user_dir }}/.config/Code/User" state: directory + mode: "0755" - name: VSCode - Basics - Copy global settings ansible.builtin.copy: src: "{{ role_path }}/files/vscode-settings.json" dest: "{{ ansible_user_dir }}/.config/Code/User/settings.json" + mode: "0644" # Dev Env - C/C++ Development Tools - name: Devel - C/C++ - when: user_lang_cpp == true + when: user_lang_cpp block: - name: Devel - C/C++ - Install developer tools become: true @@ -61,7 +63,7 @@ # Dev Env - Golang Development Tools - name: Devel - Golang - when: user_lang_golang == true + when: user_lang_golang block: - name: Devel - Golang - Install developer tools become: true @@ -75,7 +77,7 @@ # Dev Env - LaTeX Distribution - name: Devel - LaTeX - when: user_lang_latex == true + when: user_lang_latex block: - name: Devel - LaTeX - Install basic TeX distribution become: true diff --git a/tasks/devel-Darwin.yml b/tasks/devel-Darwin.yml index e9317d6..8e9f6b6 100644 --- a/tasks/devel-Darwin.yml +++ b/tasks/devel-Darwin.yml @@ -8,7 +8,7 @@ # Install Visual Studio Code and Set Basic Configuration - name: VSCode - Basics - when: user_vscode == true + when: user_vscode block: - name: VSCode - Basics - Install community.general.homebrew_cask: @@ -35,14 +35,16 @@ ansible.builtin.file: path: "{{ ansible_user_dir }}/Library/Application Support/Code/User" state: directory + mode: "0755" - name: VSCode - Basics - Copy global settings ansible.builtin.copy: src: "{{ role_path }}/files/vscode-settings.json" dest: "{{ ansible_user_dir }}/Library/Application Support/Code/User/settings.json" + mode: "0644" # Dev Env - C/C++ Development Tools - name: Devel - C/C++ - when: user_lang_cpp == true + when: user_lang_cpp block: - name: Devel - C/C++ - Install developer tools community.general.homebrew: @@ -58,7 +60,7 @@ # Dev Env - Golang Development Tools - name: Devel - Golang - when: user_lang_golang == true + when: user_lang_golang block: - name: Devel - Golang - Install developer tools community.general.homebrew: @@ -71,7 +73,7 @@ # Dev Env - LaTeX Distribution - name: Devel - LaTeX - when: user_vscode == true and user_lang_latex == true + when: user_vscode and user_lang_latex block: - name: Devel - LaTeX - Install basic TeX distribution community.general.homebrew_cask: diff --git a/tasks/devel-Debian.yml b/tasks/devel-Debian.yml index 73204af..ee70777 100644 --- a/tasks/devel-Debian.yml +++ b/tasks/devel-Debian.yml @@ -10,7 +10,7 @@ # Install Visual Studio Code and Set Basic Configuration - name: VSCode - Basics - when: user_vscode == true + when: user_vscode block: - name: VSCode - Basics - Add Repo Key become: true @@ -46,14 +46,16 @@ ansible.builtin.file: path: "{{ ansible_user_dir }}/.config/Code/User" state: directory + mode: "0755" - name: VSCode - Basics - Copy global settings ansible.builtin.copy: src: "{{ role_path }}/files/vscode-settings.json" dest: "{{ ansible_user_dir }}/.config/Code/User/settings.json" + mode: "0644" # Dev Env - C/C++ Development Tools - name: Devel - C/C++ - when: user_lang_cpp == true + when: user_lang_cpp block: - name: Devel - C/C++ - Install developer tools become: true @@ -70,7 +72,7 @@ # Dev Env - Golang Development Tools - name: Devel - Golang - when: user_lang_golang == true + when: user_lang_golang block: - name: Devel - Golang - Install developer tools become: true @@ -82,7 +84,7 @@ # Dev Env - LaTeX Distribution - name: Devel - LaTeX - when: user_lang_latex == true + when: user_lang_latex block: - name: Devel - LaTeX - Install basic TeX distribution ansible.builtin.package: diff --git a/tasks/devel.yml b/tasks/devel.yml index c9b3501..39c6508 100644 --- a/tasks/devel.yml +++ b/tasks/devel.yml @@ -17,11 +17,11 @@ ansible.builtin.include_tasks: "{{ item }}" with_first_found: - "devel-{{ ansible_distribution }}.yml" - - "devel-{{ (override_os_family is defined) | ternary(override_os_family,ansible_os_family) }}.yml" + - "devel-{{ (override_os_family is defined) | ternary(override_os_family, ansible_os_family) }}.yml" # Install Visual Studio Code and Set Basic Configuration - name: VSCode - Basics - when: user_vscode == true + when: user_vscode block: - name: VSCode - Basics - Configure ansible.builtin.shell: | @@ -37,7 +37,7 @@ # VS Code - C/C++ Development Tools - name: VSCode - C/C++ - when: user_vscode == true and user_lang_cpp == true + when: user_vscode and user_lang_cpp block: - name: VSCode - C/C++ - Configure VS Code ansible.builtin.shell: | @@ -48,14 +48,14 @@ # VS Code - Python Development Tools - name: Devel - Python - Install python dev packages - when: user_lang_python == true + when: user_lang_python ansible.builtin.pip: name: - autopep8 # - pylint # must be installed in each venv individually! executable: "{{ override_pip_exe | default(default_pip3_exe) }}" - name: VSCode - Python - when: user_vscode == true and user_lang_python == true + when: user_vscode and user_lang_python block: - name: VSCode - Python - Configure VS Code ansible.builtin.shell: | @@ -65,16 +65,18 @@ # VC Code - Golang Development Tools # https://golang.org/doc/install - name: Devel - Golang - Setup Environment - when: user_lang_golang == true + when: user_lang_golang block: - name: Devel - Golang - Create workspace directory ansible.builtin.file: path: "{{ user_lang_golang_gopath }}" state: directory + mode: "0755" - name: Devel - Golang - Create zshrc-host ansible.builtin.file: path: "{{ ansible_user_dir }}/.zshrc-host" state: touch + mode: "0644" - name: Devel - Golang - Add GOPATH ansible.builtin.lineinfile: path: "{{ ansible_user_dir }}/.zshrc-host" @@ -91,7 +93,7 @@ # and group all golang stuff in one section inside zshrc-host - name: VSCode - Golang - when: user_vscode == true and user_lang_golang == true + when: user_vscode and user_lang_golang block: - name: VSCode - Golang - Configure VS Code ansible.builtin.shell: | @@ -100,7 +102,7 @@ # VS Code - LaTeX Distribution - name: Devel - LaTeX - Install TeX packages - when: user_lang_latex == true + when: user_lang_latex become: true ansible.builtin.shell: | PATH=/Library/TeX/texbin:$PATH @@ -109,7 +111,7 @@ tlmgr install collection-fontsextra collection-fontsrecommended collection-fontutils collection-langgerman collection-langenglish collection-mathscience tlmgr install todonotes textpos lipsum pgfopts xpatch enumitem nomencl glossaries glossaries-german glossaries-english datatool mfirstuc xfor substr tracklang placeins placeins-plain csquotes appendixnumberbeamer fontaxes hyphenat - name: VSCode - LaTeX - when: user_vscode == true and user_lang_latex == true + when: user_vscode and user_lang_latex block: - name: VSCode - Basics - Configure ansible.builtin.shell: | diff --git a/tasks/usersettings.yml b/tasks/usersettings.yml index ed01d40..44e52c8 100644 --- a/tasks/usersettings.yml +++ b/tasks/usersettings.yml @@ -69,6 +69,7 @@ ansible.builtin.copy: src: "{{ item.src }}" dest: "{{ item.dest }}" + mode: "0644" with_items: - { src: "{{ role_path }}/files/_gitignore_global", @@ -86,6 +87,7 @@ ansible.builtin.file: path: "{{ item }}" state: directory + mode: "0755" with_items: - "{{ ansible_user_dir }}/.config/htop/" - name: Usersettings - Set templated dotfiles @@ -93,6 +95,7 @@ src: "{{ item.src }}" dest: "{{ item.dest }}" force: "{{ item.force }}" + mode: "0644" ignore_errors: true with_items: - { @@ -116,22 +119,25 @@ force: false, } - name: Usersettings - Set global gitconfig - when: usersetup_gitconfig == true + when: usersetup_gitconfig ansible.builtin.template: src: "{{ role_path }}/templates/_gitconfig.j2" dest: "{{ ansible_user_dir }}/.gitconfig" + mode: "0644" - name: Usersettings - Vim Plugings - when: usersetup_vimplugins == true + when: usersetup_vimplugins block: - name: Usersettings - Create .vim directory ansible.builtin.file: path: "{{ ansible_user_dir }}/.vim/autoload" state: directory + mode: "0755" - name: Usersettings - Install vim plugin manager ansible.builtin.get_url: url: https://tpo.pe/pathogen.vim dest: "{{ ansible_user_dir }}/.vim/autoload/pathogen.vim" + mode: "0644" - name: Usersettings - Install vim plugins ansible.builtin.git: repo: "{{ item.repo }}" diff --git a/tasks/usersetup-Archlinux.yml b/tasks/usersetup-Archlinux.yml index 2b728c0..1696396 100644 --- a/tasks/usersetup-Archlinux.yml +++ b/tasks/usersetup-Archlinux.yml @@ -9,7 +9,7 @@ - name: Usersetup - Change login shell to zsh for current user when: - - common_usersetup.stat.exists == false and usersetup_chsh == true + - not common_usersetup.stat.exists and usersetup_chsh become: true ansible.builtin.user: name: "{{ ansible_user_id }}" @@ -25,14 +25,14 @@ # - name: Usersetup - Setup locale en_US # when: -# - common_usersetup.stat.exists == false +# - not common_usersetup.stat.exists # become: true # ansible.builtin.locale_gen: # name: en_US.UTF-8 # state: present # - name: Usersetup - Setup locale de_DE # when: -# - common_usersetup.stat.exists == false +# - not common_usersetup.stat.exists # become: true # ansible.builtin.locale_gen: # name: de_DE.UTF-8 @@ -40,7 +40,8 @@ - name: Usersetup - Create lockfile when: - - common_usersetup.stat.exists == false + - not common_usersetup.stat.exists ansible.builtin.file: path: "{{ ansible_user_dir }}/.ansbl-common-usersetup" state: touch + mode: "0644" diff --git a/tasks/usersetup-Centos.yml b/tasks/usersetup-Centos.yml index a26d477..b846ca6 100644 --- a/tasks/usersetup-Centos.yml +++ b/tasks/usersetup-Centos.yml @@ -9,7 +9,7 @@ - name: Usersetup - Change login shell to zsh for current user when: - - common_usersetup.stat.exists == false and usersetup_chsh == true + - not common_usersetup.stat.exists and usersetup_chsh become: true ansible.builtin.user: name: "{{ ansible_user_id }}" @@ -25,14 +25,14 @@ # - name: Usersetup - Setup locale en_US # when: -# - common_usersetup.stat.exists == false +# - not common_usersetup.stat.exists # become: true # ansible.builtin.locale_gen: # name: en_US.UTF-8 # state: present # - name: Usersetup - Setup locale de_DE # when: -# - common_usersetup.stat.exists == false +# - not common_usersetup.stat.exists # become: true # ansible.builtin.locale_gen: # name: de_DE.UTF-8 @@ -40,7 +40,8 @@ - name: Usersetup - Create lockfile when: - - common_usersetup.stat.exists == false + - not common_usersetup.stat.exists ansible.builtin.file: path: "{{ ansible_user_dir }}/.ansbl-common-usersetup" state: touch + mode: "0644" diff --git a/tasks/usersetup-Darwin.yml b/tasks/usersetup-Darwin.yml index 9c6b697..c0cd41f 100644 --- a/tasks/usersetup-Darwin.yml +++ b/tasks/usersetup-Darwin.yml @@ -9,7 +9,7 @@ - name: Usersetup - Change login shell to zsh for current user when: - - common_usersetup.stat.exists == false and usersetup_chsh == true + - not common_usersetup.stat.exists and usersetup_chsh become: true ansible.builtin.user: name: "{{ ansible_user_id }}" @@ -17,7 +17,8 @@ - name: Usersetup - Create lockfile when: - - common_usersetup.stat.exists == false + - not common_usersetup.stat.exists ansible.builtin.file: path: "{{ ansible_user_dir }}/.ansbl-common-usersetup" state: touch + mode: "0644" diff --git a/tasks/usersetup-Debian.yml b/tasks/usersetup-Debian.yml index 5d6dfef..e226e9b 100644 --- a/tasks/usersetup-Debian.yml +++ b/tasks/usersetup-Debian.yml @@ -9,7 +9,7 @@ - name: Usersetup - Change login shell to zsh for current user when: - - common_usersetup.stat.exists == false and usersetup_chsh == true + - not common_usersetup.stat.exists and usersetup_chsh become: true ansible.builtin.user: name: "{{ ansible_user_id }}" @@ -24,14 +24,14 @@ - name: Usersetup - Setup locale en_US when: - - common_usersetup.stat.exists == false + - not common_usersetup.stat.exists become: true ansible.builtin.locale_gen: name: en_US.UTF-8 state: present - name: Usersetup - Setup locale de_DE when: - - common_usersetup.stat.exists == false + - not common_usersetup.stat.exists become: true ansible.builtin.locale_gen: name: de_DE.UTF-8 @@ -39,7 +39,8 @@ - name: Usersetup - Create lockfile when: - - common_usersetup.stat.exists == false + - not common_usersetup.stat.exists ansible.builtin.file: path: "{{ ansible_user_dir }}/.ansbl-common-usersetup" state: touch + mode: "0644" diff --git a/tasks/usersetup-FreeBSD.yml b/tasks/usersetup-FreeBSD.yml index 420d82b..fb1e772 100644 --- a/tasks/usersetup-FreeBSD.yml +++ b/tasks/usersetup-FreeBSD.yml @@ -9,7 +9,7 @@ - name: Usersetup - Change login shell to zsh for current user when: - - common_usersetup.stat.exists == false and usersetup_chsh == true + - not common_usersetup.stat.exists and usersetup_chsh become: true ansible.builtin.user: name: "{{ ansible_user_id }}" @@ -24,14 +24,14 @@ # - name: Usersetup - Setup locale en_US # when: -# - common_usersetup.stat.exists == false +# - not common_usersetup.stat.exists # become: true # ansible.builtin.locale_gen: # name: en_US.UTF-8 # state: present # - name: Usersetup - Setup locale de_DE # when: -# - common_usersetup.stat.exists == false +# - not common_usersetup.stat.exists # become: true # ansible.builtin.locale_gen: # name: de_DE.UTF-8 @@ -39,7 +39,8 @@ - name: Usersetup - Create lockfile when: - - common_usersetup.stat.exists == false + - not common_usersetup.stat.exists ansible.builtin.file: path: "{{ ansible_user_dir }}/.ansbl-common-usersetup" state: touch + mode: "0644" diff --git a/tasks/usertools-FreeBSD.yml b/tasks/usertools-FreeBSD.yml index 8ea19f9..ddd1301 100644 --- a/tasks/usertools-FreeBSD.yml +++ b/tasks/usertools-FreeBSD.yml @@ -12,5 +12,4 @@ - rsync - icdiff - iftop - #- ansible diff: false diff --git a/tasks/usertools.yml b/tasks/usertools.yml index b91d4a2..80ad463 100644 --- a/tasks/usertools.yml +++ b/tasks/usertools.yml @@ -5,4 +5,4 @@ ansible.builtin.include_tasks: "{{ item }}" with_first_found: - "usertools-{{ ansible_distribution }}.yml" - - "usertools-{{ (override_os_family is defined) | ternary(override_os_family,ansible_os_family) }}.yml" + - "usertools-{{ (override_os_family is defined) | ternary(override_os_family, ansible_os_family) }}.yml"