diff --git a/README.md b/README.md index ffeed65..72845ed 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ You can simply run the whole role: - name: Basic User Shell Setup hosts: all tasks: - - import_role: + - ansible.builtin.import_role: name: common ``` @@ -69,39 +69,39 @@ Or call the different tasks individually: hosts: all tasks: - name: Basics - Update first - include_role: + ansible.builtin.import_role: name: common tasks_from: update when: common_settingsonly | default(false) == false ## Run rasks from the role's main.yml - name: Basics - Install essential tools - include_role: + ansible.builtin.import_role: name: common tasks_from: essentials when: common_settingsonly | default(false) == false - name: Basics - Install basic tools - include_role: + ansible.builtin.import_role: name: common tasks_from: tools when: common_settingsonly | default(false) == false - name: Basics - Setup user shell - include_role: + ansible.builtin.import_role: name: common tasks_from: usersetup when: common_settingsonly | default(false) == false - name: Basics - Install dotfiles - import_role: + ansible.builtin.import_role: name: common tasks_from: usersettings ## Additionall tasks for a work station machine - name: Basics - Install user's working utilities - import_role: + ansible.builtin.import_role: name: common tasks_from: usertools - name: Basics - Install and configure development env (and VS Code) - import_role: + ansible.builtin.import_role: name: common tasks_from: devel ``` diff --git a/tasks/devel-Archlinux.yml b/tasks/devel-Archlinux.yml index 21041e0..239d5f9 100644 --- a/tasks/devel-Archlinux.yml +++ b/tasks/devel-Archlinux.yml @@ -2,7 +2,7 @@ # Common/Devel: Install and Configure Dev Env - ArchLinux Version - name: devel - Fonts - package: + ansible.builtin.package: name: "{{ packages }}" state: present vars: @@ -13,25 +13,25 @@ - name: vscode - Basics block: - name: vscode - Basics - Install - package: + ansible.builtin.package: name: "{{ packages }}" state: present vars: packages: - code - name: vscode - Basics - Additional dependencies - package: + ansible.builtin.package: name: "{{ packages }}" state: present vars: packages: - plantuml - name: vscode - Basics - Create settings directory - file: + ansible.builtin.file: path: "{{ ansible_user_dir }}/.config/Code/User" state: directory - name: vscode - Basics - Copy global settings - copy: + ansible.builtin.copy: src: "{{ role_path }}/files/vscode-settings.json" dest: "{{ ansible_user_dir }}/.config/Code/User/settings.json" when: user_vscode == true @@ -40,7 +40,7 @@ - name: devel - C/C++ block: - name: devel - C/C++ - Install developer tools - package: + ansible.builtin.package: name: "{{ packages }}" state: present vars: @@ -55,7 +55,7 @@ - name: devel - Golang block: - name: devel - Golang - Install developer tools - package: + ansible.builtin.package: name: "{{ packages }}" state: present vars: @@ -67,7 +67,7 @@ - name: devel - LaTeX block: - name: devel - LaTeX - Install basic TeX distribution - package: + ansible.builtin.package: name: "{{ packages }}" state: present vars: diff --git a/tasks/devel-Darwin.yml b/tasks/devel-Darwin.yml index 700f234..b0b43a2 100644 --- a/tasks/devel-Darwin.yml +++ b/tasks/devel-Darwin.yml @@ -2,7 +2,7 @@ # Common/Devel: Install and Configure Dev Env - macOS Version - name: devel - Fonts - homebrew_cask: + ansible.builtin.homebrew_cask: name: homebrew/cask-fonts/font-hack state: present @@ -10,32 +10,32 @@ - name: vscode - Basics block: - name: vscode - Basics - Install - homebrew_cask: + ansible.builtin.homebrew_cask: name: "{{ packages }}" state: present vars: packages: - visual-studio-code # - name: vscode - Basics - Additional dependencies (1) - # homebrew_cask: + # ansible.builtin.homebrew_cask: # name: "{{ packages }}" # state: present # vars: # packages: # - java # TODO: needs user password! # - name: vscode - Basics - Additional dependencies (2) - # homebrew: + # ansible.builtin.homebrew: # name: "{{ packages }}" # state: present # vars: # packages: # - graphviz - name: vscode - Basics - Create settings directory - file: + ansible.builtin.file: path: "{{ ansible_user_dir }}/Library/Application Support/Code/User" state: directory - name: vscode - Basics - Copy global settings - copy: + ansible.builtin.copy: src: "{{ role_path }}/files/vscode-settings.json" dest: "{{ ansible_user_dir }}/Library/Application Support/Code/User/settings.json" when: user_vscode == true @@ -44,7 +44,7 @@ - name: devel - C/C++ block: - name: devel - C/C++ - Install developer tools - homebrew: + ansible.builtin.homebrew: name: "{{ packages }}" state: present vars: @@ -59,7 +59,7 @@ - name: devel - Golang block: - name: devel - Golang - Install developer tools - homebrew: + ansible.builtin.homebrew: name: "{{ packages }}" state: present vars: @@ -71,7 +71,7 @@ - name: devel - LaTeX block: - name: devel - LaTeX - Install basic TeX distribution - homebrew_cask: + ansible.builtin.homebrew_cask: name: "{{ packages }}" state: present vars: diff --git a/tasks/devel-Debian.yml b/tasks/devel-Debian.yml index cffc34a..eb1a181 100644 --- a/tasks/devel-Debian.yml +++ b/tasks/devel-Debian.yml @@ -3,7 +3,7 @@ - name: devel - Fonts become: yes - apt: + ansible.builtin.apt: name: fonts-hack-ttf state: present @@ -12,18 +12,18 @@ block: - name: vscode - Basics - Add Repo Key become: yes - apt_key: + ansible.builtin.apt_key: url: "https://packages.microsoft.com/keys/microsoft.asc" state: present - name: vscode - Basics - Add Repo become: yes - apt_repository: + ansible.builtin.apt_repository: repo: "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" filename: vscode state: present - name: vscode - Basics - Install become: yes - package: + ansible.builtin.package: name: "{{ packages }}" state: present vars: @@ -31,7 +31,7 @@ - code - name: vscode - Basics - Additional dependencies become: yes - package: + ansible.builtin.package: name: "{{ packages }}" state: present vars: @@ -39,11 +39,11 @@ - plantuml - graphviz - name: vscode - Basics - Create settings directory - file: + ansible.builtin.file: path: "{{ ansible_user_dir }}/.config/Code/User" state: directory - name: vscode - Basics - Copy global settings - copy: + ansible.builtin.copy: src: "{{ role_path }}/files/vscode-settings.json" dest: "{{ ansible_user_dir }}/.config/Code/User/settings.json" when: user_vscode == true @@ -53,7 +53,7 @@ block: - name: devel - C/C++ - Install developer tools become: yes - package: + ansible.builtin.package: name: "{{ packages }}" state: present vars: @@ -69,7 +69,7 @@ block: - name: devel - Golang - Install developer tools become: yes - apt: + ansible.builtin.apt: name: "{{ packages }}" state: present vars: @@ -81,7 +81,7 @@ - name: devel - LaTeX block: - name: devel - LaTeX - Install basic TeX distribution - package: + ansible.builtin.package: name: "{{ packages }}" state: present vars: diff --git a/tasks/devel.yml b/tasks/devel.yml index 2a97d75..05b35b3 100644 --- a/tasks/devel.yml +++ b/tasks/devel.yml @@ -14,7 +14,7 @@ # - user_lang_latex: Boolean for LaTeX - name: vscode - Install and configure VS Code - include_tasks: "{{ item }}" + 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" @@ -23,7 +23,7 @@ - name: vscode - Basics block: - name: vscode - Basics - Configure - shell: | + ansible.builtin.shell: | PATH=/usr/local/bin:$PATH code --install-extension chiehyu.vscode-astyle code --install-extension editorconfig @@ -39,7 +39,7 @@ - name: vscode - C/C++ block: - name: vscode - C/C++ - Configure VS Code - shell: | + ansible.builtin.shell: | PATH=/usr/local/bin:$PATH code --install-extension ms-vscode.cpptools code --install-extension ms-vscode.cmake-tools @@ -48,7 +48,7 @@ # VS Code - Python Development Tools - name: devel - Python - Install python dev packages - pip: + ansible.builtin.pip: name: - autopep8 # - pylint # must be installed in each venv individually! @@ -57,7 +57,7 @@ - name: vscode - Python block: - name: vscode - Python - Configure VS Code - shell: | + ansible.builtin.shell: | PATH=/usr/local/bin:$PATH code --install-extension ms-python.python when: user_vscode == true and user_lang_python == true @@ -67,21 +67,21 @@ - name: devel - Golang - Setup Environment block: - name: devel - Golang - Create workspace directory - file: + ansible.builtin.file: path: "{{ user_lang_golang_gopath }}" state: directory - name: devel - Golang - Create zshrc-host - file: + ansible.builtin.file: path: "{{ ansible_user_dir}}/.zshrc-host" state: touch - name: devel - Golang - Add GOPATH - lineinfile: + ansible.builtin.lineinfile: path: "{{ ansible_user_dir}}/.zshrc-host" line: "export GOPATH={{ user_lang_golang_gopath }}" state: present backup: yes - name: devel - Golang - Add go bin to PATH - lineinfile: + ansible.builtin.lineinfile: path: "{{ ansible_user_dir}}/.zshrc-host" line: "export PATH=$PATH:{{ user_lang_golang_gopath }}/bin" state: present @@ -93,7 +93,7 @@ - name: vscode - Golang block: - name: vscode - Golang - Configure VS Code - shell: | + ansible.builtin.shell: | PATH=/usr/local/bin:$PATH code --install-extension golang.go when: user_vscode == true and user_lang_golang == true @@ -101,7 +101,7 @@ # VS Code - LaTeX Distribution - name: devel - LaTeX - Install TeX packages become: yes - shell: | + ansible.builtin.shell: | PATH=/Library/TeX/texbin:$PATH tlmgr install latexmk latexindent biblatex logreq xstring biber tlmgr install collection-fontsextra collection-fontsrecommended collection-fontutils collection-langgerman collection-langenglish collection-mathscience @@ -110,7 +110,7 @@ - name: vscode - LaTeX block: - name: vscode - Basics - Configure - shell: | + ansible.builtin.shell: | PATH=/usr/local/bin:$PATH code --install-extension james-yu.latex-workshop code --install-extension ban.spellright diff --git a/tasks/essentials-Archlinux.yml b/tasks/essentials-Archlinux.yml index 53f11ae..7809063 100644 --- a/tasks/essentials-Archlinux.yml +++ b/tasks/essentials-Archlinux.yml @@ -3,7 +3,7 @@ - name: essentials - Install essential utilities become: yes - package: + ansible.builtin.package: name: "{{ packages }}" state: present vars: diff --git a/tasks/essentials-Centos.yml b/tasks/essentials-Centos.yml index 60aa934..8c55ce3 100644 --- a/tasks/essentials-Centos.yml +++ b/tasks/essentials-Centos.yml @@ -3,7 +3,7 @@ - name: essentials - Install essential utilities become: yes - yum: + ansible.builtin.yum: name: "{{ packages }}" state: present vars: @@ -16,11 +16,11 @@ - name: essentials - Install pip - Activate EPEL become: yes - yum: + ansible.builtin.yum: name: epel-release state: present - name: essentials - Install pip - Install become: yes - yum: + ansible.builtin.yum: name: python-pip state: present diff --git a/tasks/essentials-Darwin.yml b/tasks/essentials-Darwin.yml index 035a6bd..979c659 100644 --- a/tasks/essentials-Darwin.yml +++ b/tasks/essentials-Darwin.yml @@ -2,7 +2,7 @@ # Common/Essentials: Essential Utilities (git, curl; vim, tmux, zsh, pip) - macOS Version - name: essentials - Install essential utilities - package: + ansible.builtin.package: name: "{{ packages }}" state: present vars: diff --git a/tasks/essentials-Debian.yml b/tasks/essentials-Debian.yml index f8ab6f1..d15f484 100644 --- a/tasks/essentials-Debian.yml +++ b/tasks/essentials-Debian.yml @@ -3,7 +3,7 @@ - name: essentials - Install essential utilities become: yes - apt: + ansible.builtin.apt: name: "{{ packages }}" state: present vars: diff --git a/tasks/essentials.yml b/tasks/essentials.yml index 278d4c1..13638c3 100644 --- a/tasks/essentials.yml +++ b/tasks/essentials.yml @@ -2,7 +2,7 @@ # Common/Essentials: Essential Utilities (git, curl; vim, tmux, zsh, pip) - name: essentials - Install essential utilities - include_tasks: "{{ item }}" + ansible.builtin.include_tasks: "{{ item }}" with_first_found: - "essentials-{{ ansible_distribution }}.yml" - "essentials-{{ (override_os_family is defined) | ternary(override_os_family,ansible_os_family) }}.yml" diff --git a/tasks/main.yml b/tasks/main.yml index de8d1a6..bc14a13 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -8,22 +8,21 @@ # - Some can be run periodically # - Some must run periodically - # if role has not changed, this will not be needed when just installing updates - name: Install essential tools - include_tasks: essentials.yml + ansible.builtin.include_tasks: essentials.yml when: common_settingsonly | default(false) == false # if role has not changed, this will not be needed when just installing updates - name: Install more tools - include_tasks: tools.yml + ansible.builtin.include_tasks: tools.yml when: common_settingsonly | default(false) == false # this will just run once, because of a lock-file - name: Basics - Setup user shell - include_tasks: usersetup.yml + ansible.builtin.include_tasks: usersetup.yml when: common_settingsonly | default(false) == false # run this for every maintenance/ update cycle - name: Apply user settings - import_tasks: usersettings.yml + ansible.builtin.import_tasks: usersettings.yml diff --git a/tasks/tools-Archlinux.yml b/tasks/tools-Archlinux.yml index 13f80ae..471672e 100644 --- a/tasks/tools-Archlinux.yml +++ b/tasks/tools-Archlinux.yml @@ -4,7 +4,7 @@ - name: tools - Install basic utilities become: yes - package: + ansible.builtin.package: name: "{{ packages }}" state: present vars: diff --git a/tasks/tools-Centos.yml b/tasks/tools-Centos.yml index 83096d9..09acbfc 100644 --- a/tasks/tools-Centos.yml +++ b/tasks/tools-Centos.yml @@ -4,7 +4,7 @@ - name: tools - Install basic utilities become: yes - yum: + ansible.builtin.yum: name: "{{ packages }}" state: present vars: diff --git a/tasks/tools-Darwin.yml b/tasks/tools-Darwin.yml index 657da52..4854855 100644 --- a/tasks/tools-Darwin.yml +++ b/tasks/tools-Darwin.yml @@ -2,7 +2,7 @@ # Common/Tools: Additional Tools (depending on OS) - macOS Version - name: tools - Install basic utilities - homebrew: + ansible.builtin.homebrew: name: "{{ packages }}" state: present update_homebrew: yes diff --git a/tasks/tools-Debian.yml b/tasks/tools-Debian.yml index 465e46f..3e76d80 100644 --- a/tasks/tools-Debian.yml +++ b/tasks/tools-Debian.yml @@ -4,7 +4,7 @@ - name: tools - Install basic utilities become: yes - apt: + ansible.builtin.apt: name: "{{ packages }}" state: present vars: diff --git a/tasks/tools.yml b/tasks/tools.yml index bd736b0..b651d6e 100644 --- a/tasks/tools.yml +++ b/tasks/tools.yml @@ -2,7 +2,7 @@ # Common/Tools: Additional Tools (depending on OS) (rsync; dnsutils, htop, unzip) - name: tools - Install basic utilities - include_tasks: "{{ item }}" + ansible.builtin.include_tasks: "{{ item }}" with_first_found: - "tools-{{ ansible_distribution }}.yml" - "tools-{{ (override_os_family is defined) | ternary(override_os_family,ansible_os_family) }}.yml" diff --git a/tasks/update-Centos.yml b/tasks/update-Centos.yml index af5a1ca..201c899 100644 --- a/tasks/update-Centos.yml +++ b/tasks/update-Centos.yml @@ -3,7 +3,7 @@ - name: update - Update and upgrade all packages become: yes - yum: + ansible.builtin.yum: name: "*" state: latest update_cache: yes diff --git a/tasks/update-Darwin.yml b/tasks/update-Darwin.yml index d267668..7ee6fbe 100644 --- a/tasks/update-Darwin.yml +++ b/tasks/update-Darwin.yml @@ -2,6 +2,6 @@ # Common/Update: Install All Updates - macOS Version - name: update - Update and upgrade all packages - homebrew: + ansible.builtin.homebrew: update_homebrew: yes upgrade_all: yes diff --git a/tasks/update-Debian.yml b/tasks/update-Debian.yml index 5ffd831..3bc62bb 100644 --- a/tasks/update-Debian.yml +++ b/tasks/update-Debian.yml @@ -3,7 +3,7 @@ - name: update - Update and upgrade all packages become: yes - apt: + ansible.builtin.apt: force_apt_get: true name: "*" state: latest diff --git a/tasks/update.yml b/tasks/update.yml index cbfecdc..3674058 100644 --- a/tasks/update.yml +++ b/tasks/update.yml @@ -2,7 +2,7 @@ # Common/Update: Install All Updates - name: update - Update and upgrade all packages - include_tasks: "{{ item }}" + ansible.builtin.include_tasks: "{{ item }}" with_first_found: - "update-{{ ansible_distribution }}.yml" - "update-{{ (override_os_family is defined) | ternary(override_os_family,ansible_os_family) }}.yml" diff --git a/tasks/usersettings.yml b/tasks/usersettings.yml index b145ef5..4b9320e 100644 --- a/tasks/usersettings.yml +++ b/tasks/usersettings.yml @@ -2,17 +2,17 @@ # Common/Usersettings: Universial Dotfiles. Update regularly. - name: usersettings - Install/ Update oh-my-zsh for current user - git: + ansible.builtin.git: repo: https://github.com/robbyrussell/oh-my-zsh.git dest: .oh-my-zsh - name: usersettings - Install/ Update fzf sources - git: + ansible.builtin.git: repo: https://github.com/junegunn/fzf.git dest: .fzf register: fzf_git - name: (Re-)Install fzf - shell: ".fzf/install --key-bindings --no-completion --no-update-rc" + ansible.builtin.shell: ".fzf/install --key-bindings --no-completion --no-update-rc" when: - fzf_git.after != fzf_git.before @@ -20,62 +20,81 @@ block: - name: usersettings - Install pip virtualenvwrapper (Debian) become: yes - pip: + ansible.builtin.pip: name: virtualenvwrapper extra_args: --system when: (override_os_family is defined) | ternary(override_os_family,ansible_os_family) == "Debian" - name: usersettings - Install pip virtualenvwrapper (macOS) environment: PATH: "/usr/local/bin:{{ ansible_env.PATH }}" - pip: + ansible.builtin.pip: name: virtualenvwrapper when: (override_os_family is defined) | ternary(override_os_family,ansible_os_family) == "Darwin" - name: usersettings - Install pip virtualenvwrapper (CentOS, ArchLinux) become: yes - pip: + ansible.builtin.pip: name: virtualenvwrapper - when: (override_os_family is defined) | ternary(override_os_family,ansible_os_family) == "Centos" or + when: + (override_os_family is defined) | ternary(override_os_family,ansible_os_family) == "Centos" or (override_os_family is defined) | ternary(override_os_family,ansible_os_family) == "Archlinux" when: usersetup_virtualenvwrapper - name: usersettings - Copy dotfiles - copy: + ansible.builtin.copy: src: "{{ item.src }}" dest: "{{ item.dest }}" with_items: - - { src: "{{ role_path }}/files/_gitignore_global", dest: ".gitignore_global" } + - { + src: "{{ role_path }}/files/_gitignore_global", + dest: ".gitignore_global", + } - { src: "{{ role_path }}/files/_vimrc", dest: ".vimrc" } - - { src: "{{ role_path }}/files/_oh-my-zsh/jtbx.zsh-theme", dest: ".oh-my-zsh/custom/themes/jtbx.zsh-theme" } + - { + src: "{{ role_path }}/files/_oh-my-zsh/jtbx.zsh-theme", + dest: ".oh-my-zsh/custom/themes/jtbx.zsh-theme", + } - name: usersettings - Set zshrc - template: + ansible.builtin.template: src: "{{ role_path }}/templates/_zshrc.j2" dest: "{{ ansible_user_dir }}/.zshrc" - name: usersettings - Set global gitconfig - template: + ansible.builtin.template: src: "{{ role_path }}/templates/_gitconfig.j2" dest: "{{ ansible_user_dir }}/.gitconfig" when: usersetup_gitconfig == true - name: usersettings - Set tmux.conf - template: + ansible.builtin.template: src: "{{ role_path }}/templates/_tmux.conf.j2" dest: "{{ ansible_user_dir }}/.tmux.conf" - name: usersettings - Create .vim directory - file: + ansible.builtin.file: path: .vim/autoload state: directory - name: usersettings - Install vim plugin manager - get_url: + ansible.builtin.get_url: url: https://tpo.pe/pathogen.vim dest: .vim/autoload/pathogen.vim - name: usersettings - Install vim plugins - git: + ansible.builtin.git: repo: "{{ item.repo }}" dest: "{{ item.dest }}" with_items: - - { repo: "https://github.com/itchyny/lightline.vim", dest: ".vim/bundle/lightline" } + - { + repo: "https://github.com/itchyny/lightline.vim", + dest: ".vim/bundle/lightline", + } - { repo: "https://github.com/w0rp/ale", dest: ".vim/bundle/ale" } - - { repo: "https://github.com/airblade/vim-gitgutter", dest: ".vim/bundle/vim-gitgutter" } - - { repo: "https://github.com/sheerun/vim-polyglot", dest: ".vim/bundle/vim-polyglot" } - - { repo: "https://github.com/tpope/vim-commentary", dest: ".vim/bundle/vim-commentary" } + - { + repo: "https://github.com/airblade/vim-gitgutter", + dest: ".vim/bundle/vim-gitgutter", + } + - { + repo: "https://github.com/sheerun/vim-polyglot", + dest: ".vim/bundle/vim-polyglot", + } + - { + repo: "https://github.com/tpope/vim-commentary", + dest: ".vim/bundle/vim-commentary", + } diff --git a/tasks/usersetup-Archlinux.yml b/tasks/usersetup-Archlinux.yml index d71ca98..12f68b3 100644 --- a/tasks/usersetup-Archlinux.yml +++ b/tasks/usersetup-Archlinux.yml @@ -3,13 +3,13 @@ # Will run once per user, because of lockfile `~/.ansbl-common-usersetup` - name: usersetup - Check, if usersetup already ran - stat: + ansible.builtin.stat: path: .ansbl-common-usersetup register: common_usersetup - name: usersetup - Change login shell to zsh for current user become: yes - user: + ansible.builtin.user: name: "{{ ansible_user_id }}" shell: /bin/zsh when: @@ -18,27 +18,27 @@ # TODO: adapt to ArchLinux systems, if needed # - name: usersetup - Install locales package # become: yes -# apt: +# ansible.builtin.apt: # name: locales # state: present # - name: usersetup - Setup locale en_US # become: yes -# locale_gen: +# ansible.builtin.locale_gen: # name: en_US.UTF-8 # state: present # when: # - common_usersetup.stat.exists == false # - name: usersetup - Setup locale de_DE # become: yes -# locale_gen: +# ansible.builtin.locale_gen: # name: de_DE.UTF-8 # state: present # when: # - common_usersetup.stat.exists == false - name: usersetup - Create lockfile - file: + ansible.builtin.file: path: .ansbl-common-usersetup state: touch when: diff --git a/tasks/usersetup-Centos.yml b/tasks/usersetup-Centos.yml index 2ee1ada..3f2494b 100644 --- a/tasks/usersetup-Centos.yml +++ b/tasks/usersetup-Centos.yml @@ -3,13 +3,13 @@ # Will run once per user, because of lockfile `~/.ansbl-common-usersetup` - name: usersetup - Check, if usersetup already ran - stat: + ansible.builtin.stat: path: .ansbl-common-usersetup register: common_usersetup - name: usersetup - Change login shell to zsh for current user become: yes - user: + ansible.builtin.user: name: "{{ ansible_user_id }}" shell: /bin/zsh when: @@ -18,27 +18,27 @@ # TODO: adapt to CentOS/ RHEL systems, if needed # - name: usersetup - Install locales package # become: yes -# apt: +# ansible.builtin.apt: # name: locales # state: present # - name: usersetup - Setup locale en_US # become: yes -# locale_gen: +# ansible.builtin.locale_gen: # name: en_US.UTF-8 # state: present # when: # - common_usersetup.stat.exists == false # - name: usersetup - Setup locale de_DE # become: yes -# locale_gen: +# ansible.builtin.locale_gen: # name: de_DE.UTF-8 # state: present # when: # - common_usersetup.stat.exists == false - name: usersetup - Create lockfile - file: + ansible.builtin.file: path: .ansbl-common-usersetup state: touch when: diff --git a/tasks/usersetup-Darwin.yml b/tasks/usersetup-Darwin.yml index 43dc712..a0c84f6 100644 --- a/tasks/usersetup-Darwin.yml +++ b/tasks/usersetup-Darwin.yml @@ -3,20 +3,20 @@ # Will run once per user, because of lockfile `~/.ansbl-common-usersetup` - name: usersetup - Check, if usersetup already ran - stat: + ansible.builtin.stat: path: .ansbl-common-usersetup register: common_usersetup - name: usersetup - Change login shell to zsh for current user become: yes - user: + ansible.builtin.user: name: "{{ ansible_user_id }}" shell: /bin/zsh when: - common_usersetup.stat.exists == false and usersetup_chsh == true - name: usersetup - Create lockfile - file: + ansible.builtin.file: path: .ansbl-common-usersetup state: touch when: diff --git a/tasks/usersetup-Debian.yml b/tasks/usersetup-Debian.yml index 5d629b5..8ea37be 100644 --- a/tasks/usersetup-Debian.yml +++ b/tasks/usersetup-Debian.yml @@ -3,13 +3,13 @@ # Will run once per user, because of lockfile `~/.ansbl-common-usersetup` - name: usersetup - Check, if usersetup already ran - stat: + ansible.builtin.stat: path: .ansbl-common-usersetup register: common_usersetup - name: usersetup - Change login shell to zsh for current user become: yes - user: + ansible.builtin.user: name: "{{ ansible_user_id }}" shell: /bin/zsh when: @@ -17,27 +17,27 @@ - name: usersetup - Install locales package become: yes - apt: + ansible.builtin.apt: name: locales state: present - name: usersetup - Setup locale en_US become: yes - locale_gen: + ansible.builtin.locale_gen: name: en_US.UTF-8 state: present when: - common_usersetup.stat.exists == false - name: usersetup - Setup locale de_DE become: yes - locale_gen: + ansible.builtin.locale_gen: name: de_DE.UTF-8 state: present when: - common_usersetup.stat.exists == false - name: usersetup - Create lockfile - file: + ansible.builtin.file: path: .ansbl-common-usersetup state: touch when: diff --git a/tasks/usersetup-FreeBSD.yml b/tasks/usersetup-FreeBSD.yml index 10515c9..da23633 100644 --- a/tasks/usersetup-FreeBSD.yml +++ b/tasks/usersetup-FreeBSD.yml @@ -3,13 +3,13 @@ # Will run once per user, because of lockfile `~/.ansbl-common-usersetup` - name: usersetup - Check, if usersetup already ran - stat: + ansible.builtin.stat: path: .ansbl-common-usersetup register: common_usersetup - name: usersetup - Change login shell to zsh for current user become: yes - user: + ansible.builtin.user: name: "{{ ansible_user_id }}" shell: /usr/local/bin/zsh when: @@ -17,27 +17,27 @@ # - name: usersetup - Install locales package # become: yes -# apt: +# ansible.builtin.apt: # name: locales # state: present # - name: usersetup - Setup locale en_US # become: yes -# locale_gen: +# ansible.builtin.locale_gen: # name: en_US.UTF-8 # state: present # when: # - common_usersetup.stat.exists == false # - name: usersetup - Setup locale de_DE # become: yes -# locale_gen: +# ansible.builtin.locale_gen: # name: de_DE.UTF-8 # state: present # when: # - common_usersetup.stat.exists == false - name: usersetup - Create lockfile - file: + ansible.builtin.file: path: .ansbl-common-usersetup state: touch when: diff --git a/tasks/usersetup.yml b/tasks/usersetup.yml index 1bf7c18..c27a5ea 100644 --- a/tasks/usersetup.yml +++ b/tasks/usersetup.yml @@ -3,7 +3,7 @@ # Will run once per user, because of lockfile `~/.ansbl-common-usersetup` - name: usersetup - Run setup tasks - include_tasks: "{{ item }}" + ansible.builtin.include_tasks: "{{ item }}" with_first_found: - "usersetup-{{ ansible_distribution }}.yml" - "usersetup-{{ (override_os_family is defined) | ternary(override_os_family,ansible_os_family) }}.yml" diff --git a/tasks/usertools-Archlinux.yml b/tasks/usertools-Archlinux.yml index 14715fc..5542284 100644 --- a/tasks/usertools-Archlinux.yml +++ b/tasks/usertools-Archlinux.yml @@ -3,7 +3,7 @@ - name: usertools - Install user's working utilities become: yes - package: + ansible.builtin.package: name: "{{ packages }}" state: present vars: diff --git a/tasks/usertools-Centos.yml b/tasks/usertools-Centos.yml index 8c05fe5..44f3a1a 100644 --- a/tasks/usertools-Centos.yml +++ b/tasks/usertools-Centos.yml @@ -3,7 +3,7 @@ - name: usertools - Install user's working utilities become: yes - yum: + ansible.builtin.yum: name: "{{ packages }}" state: present vars: diff --git a/tasks/usertools-Darwin.yml b/tasks/usertools-Darwin.yml index 1ae323a..596c012 100644 --- a/tasks/usertools-Darwin.yml +++ b/tasks/usertools-Darwin.yml @@ -2,7 +2,7 @@ # Common/Usertools: User's Main Machine/ Developer Tools - macOS Version - name: usertools - Install user's working utilities - package: + ansible.builtin.package: name: "{{ packages }}" state: present vars: diff --git a/tasks/usertools-Debian.yml b/tasks/usertools-Debian.yml index 9d4b42c..13b080f 100644 --- a/tasks/usertools-Debian.yml +++ b/tasks/usertools-Debian.yml @@ -3,7 +3,7 @@ - name: usertools - Install user's working utilities become: yes - apt: + ansible.builtin.apt: name: "{{ packages }}" state: present vars: diff --git a/tasks/usertools.yml b/tasks/usertools.yml index 4a167bb..3f0e449 100644 --- a/tasks/usertools.yml +++ b/tasks/usertools.yml @@ -2,7 +2,7 @@ # Common/Usertools: User's Main Machine/ Developer Tools (nmap, rsync, icdiff, iftop, ansible) - name: usertools - Install user's working utilities - include_tasks: "{{ item }}" + 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"