Compare commits

..

3 commits

Author SHA1 Message Date
Jannik Beyerstedt 4715b1dacd [FIX] Usersettings: Re-allow running this task without sudo capabilities
Previously this task intentionally had no tasks installing any packages.
But git and pip3 are needed by some tasks, so let's try to install, but
don't fail because of missing sudo priviledges.
2022-02-13 20:54:15 +01:00
Jannik Beyerstedt a8285962a9 [TIDY] move when statements, fix whitespace
Having the when condition of a task at the top instead of bottom is
easiert to read. Also some spaces were another whitespace character on
accident.
2022-02-13 20:52:22 +01:00
Jannik Beyerstedt a9e89283a2 [FIX] Usersettings: FreeBSD has another pip package 2022-02-13 20:28:25 +01:00
13 changed files with 87 additions and 76 deletions

View file

@ -69,27 +69,27 @@ Or call the different tasks individually:
hosts: all hosts: all
tasks: tasks:
- name: Basics - Update first - name: Basics - Update first
when: common_settingsonly | default(false) == false
ansible.builtin.import_role: ansible.builtin.import_role:
name: common name: common
tasks_from: update tasks_from: update
when: common_settingsonly | default(false) == false
## Run rasks from the role's main.yml ## Run rasks from the role's main.yml
- name: Basics - Install essential tools - name: Basics - Install essential tools
when: common_settingsonly | default(false) == false
ansible.builtin.import_role: ansible.builtin.import_role:
name: common name: common
tasks_from: essentials tasks_from: essentials
when: common_settingsonly | default(false) == false
- name: Basics - Install basic tools - name: Basics - Install basic tools
when: common_settingsonly | default(false) == false
ansible.builtin.import_role: ansible.builtin.import_role:
name: common name: common
tasks_from: tools tasks_from: tools
when: common_settingsonly | default(false) == false
- name: Basics - Setup user shell - name: Basics - Setup user shell
when: common_settingsonly | default(false) == false
ansible.builtin.import_role: ansible.builtin.import_role:
name: common name: common
tasks_from: usersetup tasks_from: usersetup
when: common_settingsonly | default(false) == false
- name: Basics - Install dotfiles - name: Basics - Install dotfiles
ansible.builtin.import_role: ansible.builtin.import_role:
name: common name: common

View file

@ -11,6 +11,7 @@
# Install Visual Studio Code and Set Basic Configuration # Install Visual Studio Code and Set Basic Configuration
- name: vscode - Basics - name: vscode - Basics
when: user_vscode == true
block: block:
- name: vscode - Basics - Install - name: vscode - Basics - Install
ansible.builtin.package: ansible.builtin.package:
@ -28,16 +29,16 @@
- plantuml - plantuml
- name: vscode - Basics - Create settings directory - name: vscode - Basics - Create settings directory
ansible.builtin.file: ansible.builtin.file:
path: "{{ ansible_user_dir }}/.config/Code/User" path: "{{ ansible_user_dir }}/.config/Code/User"
state: directory state: directory
- name: vscode - Basics - Copy global settings - name: vscode - Basics - Copy global settings
ansible.builtin.copy: ansible.builtin.copy:
src: "{{ role_path }}/files/vscode-settings.json" src: "{{ role_path }}/files/vscode-settings.json"
dest: "{{ ansible_user_dir }}/.config/Code/User/settings.json" dest: "{{ ansible_user_dir }}/.config/Code/User/settings.json"
when: user_vscode == true
# Dev Env - C/C++ Development Tools # Dev Env - C/C++ Development Tools
- name: devel - C/C++ - name: devel - C/C++
when: user_lang_cpp == true
block: block:
- name: devel - C/C++ - Install developer tools - name: devel - C/C++ - Install developer tools
ansible.builtin.package: ansible.builtin.package:
@ -46,13 +47,13 @@
vars: vars:
packages: packages:
- clang-format - clang-format
when: user_lang_cpp == true
# Dev Env - Python Development Tools # Dev Env - Python Development Tools
# all done in vscode.yml # all done in vscode.yml
# Dev Env - Golang Development Tools # Dev Env - Golang Development Tools
- name: devel - Golang - name: devel - Golang
when: user_lang_golang == true
block: block:
- name: devel - Golang - Install developer tools - name: devel - Golang - Install developer tools
ansible.builtin.package: ansible.builtin.package:
@ -61,10 +62,10 @@
vars: vars:
packages: packages:
- go - go
when: user_lang_golang == true
# Dev Env - LaTeX Distribution # Dev Env - LaTeX Distribution
- name: devel - LaTeX - name: devel - LaTeX
when: user_lang_latex == true
block: block:
- name: devel - LaTeX - Install basic TeX distribution - name: devel - LaTeX - Install basic TeX distribution
ansible.builtin.package: ansible.builtin.package:
@ -77,4 +78,3 @@
# - texlive-science # - texlive-science
# - texlive-fontsextra # - texlive-fontsextra
- biber - biber
when: user_lang_latex == true

View file

@ -8,6 +8,7 @@
# Install Visual Studio Code and Set Basic Configuration # Install Visual Studio Code and Set Basic Configuration
- name: vscode - Basics - name: vscode - Basics
when: user_vscode == true
block: block:
- name: vscode - Basics - Install - name: vscode - Basics - Install
ansible.builtin.homebrew_cask: ansible.builtin.homebrew_cask:
@ -32,16 +33,16 @@
# - graphviz # - graphviz
- name: vscode - Basics - Create settings directory - name: vscode - Basics - Create settings directory
ansible.builtin.file: ansible.builtin.file:
path: "{{ ansible_user_dir }}/Library/Application Support/Code/User" path: "{{ ansible_user_dir }}/Library/Application Support/Code/User"
state: directory state: directory
- name: vscode - Basics - Copy global settings - name: vscode - Basics - Copy global settings
ansible.builtin.copy: ansible.builtin.copy:
src: "{{ role_path }}/files/vscode-settings.json" src: "{{ role_path }}/files/vscode-settings.json"
dest: "{{ ansible_user_dir }}/Library/Application Support/Code/User/settings.json" dest: "{{ ansible_user_dir }}/Library/Application Support/Code/User/settings.json"
when: user_vscode == true
# Dev Env - C/C++ Development Tools # Dev Env - C/C++ Development Tools
- name: devel - C/C++ - name: devel - C/C++
when: user_lang_cpp == true
block: block:
- name: devel - C/C++ - Install developer tools - name: devel - C/C++ - Install developer tools
ansible.builtin.homebrew: ansible.builtin.homebrew:
@ -50,13 +51,13 @@
vars: vars:
packages: packages:
- clang-format - clang-format
when: user_lang_cpp == true
# Dev Env - Python Development Tools # Dev Env - Python Development Tools
# all done in vscode.yml # all done in vscode.yml
# Dev Env - Golang Development Tools # Dev Env - Golang Development Tools
- name: devel - Golang - name: devel - Golang
when: user_lang_golang == true
block: block:
- name: devel - Golang - Install developer tools - name: devel - Golang - Install developer tools
ansible.builtin.homebrew: ansible.builtin.homebrew:
@ -65,10 +66,10 @@
vars: vars:
packages: packages:
- go - go
when: user_lang_golang == true
# Dev Env - LaTeX Distribution # Dev Env - LaTeX Distribution
- name: devel - LaTeX - name: devel - LaTeX
when: user_vscode == true and user_lang_latex == true
block: block:
- name: devel - LaTeX - Install basic TeX distribution - name: devel - LaTeX - Install basic TeX distribution
ansible.builtin.homebrew_cask: ansible.builtin.homebrew_cask:
@ -78,4 +79,3 @@
packages: packages:
- basictex - basictex
- tex-live-utility - tex-live-utility
when: user_vscode == true and user_lang_latex == true

View file

@ -9,6 +9,7 @@
# Install Visual Studio Code and Set Basic Configuration # Install Visual Studio Code and Set Basic Configuration
- name: vscode - Basics - name: vscode - Basics
when: user_vscode == true
block: block:
- name: vscode - Basics - Add Repo Key - name: vscode - Basics - Add Repo Key
become: yes become: yes
@ -40,16 +41,16 @@
- graphviz - graphviz
- name: vscode - Basics - Create settings directory - name: vscode - Basics - Create settings directory
ansible.builtin.file: ansible.builtin.file:
path: "{{ ansible_user_dir }}/.config/Code/User" path: "{{ ansible_user_dir }}/.config/Code/User"
state: directory state: directory
- name: vscode - Basics - Copy global settings - name: vscode - Basics - Copy global settings
ansible.builtin.copy: ansible.builtin.copy:
src: "{{ role_path }}/files/vscode-settings.json" src: "{{ role_path }}/files/vscode-settings.json"
dest: "{{ ansible_user_dir }}/.config/Code/User/settings.json" dest: "{{ ansible_user_dir }}/.config/Code/User/settings.json"
when: user_vscode == true
# Dev Env - C/C++ Development Tools # Dev Env - C/C++ Development Tools
- name: devel - C/C++ - name: devel - C/C++
when: user_lang_cpp == true
block: block:
- name: devel - C/C++ - Install developer tools - name: devel - C/C++ - Install developer tools
become: yes become: yes
@ -59,13 +60,13 @@
vars: vars:
packages: packages:
- clang-format - clang-format
when: user_lang_cpp == true
# Dev Env - Python Development Tools # Dev Env - Python Development Tools
# all done in vscode.yml # all done in vscode.yml
# Dev Env - Golang Development Tools # Dev Env - Golang Development Tools
- name: devel - Golang - name: devel - Golang
when: user_lang_golang == true
block: block:
- name: devel - Golang - Install developer tools - name: devel - Golang - Install developer tools
become: yes become: yes
@ -75,10 +76,10 @@
vars: vars:
packages: packages:
- golang - golang
when: user_lang_golang == true
# Dev Env - LaTeX Distribution # Dev Env - LaTeX Distribution
- name: devel - LaTeX - name: devel - LaTeX
when: user_lang_latex == true
block: block:
- name: devel - LaTeX - Install basic TeX distribution - name: devel - LaTeX - Install basic TeX distribution
ansible.builtin.package: ansible.builtin.package:
@ -91,4 +92,3 @@
# - texlive-science # - texlive-science
# - texlive-fonts-extra # - texlive-fonts-extra
- biber - biber
when: user_lang_latex == true

View file

@ -21,6 +21,7 @@
# Install Visual Studio Code and Set Basic Configuration # Install Visual Studio Code and Set Basic Configuration
- name: vscode - Basics - name: vscode - Basics
when: user_vscode == true
block: block:
- name: vscode - Basics - Configure - name: vscode - Basics - Configure
ansible.builtin.shell: | ansible.builtin.shell: |
@ -33,10 +34,10 @@
code --install-extension jebbs.plantuml code --install-extension jebbs.plantuml
code --install-extension mechatroner.rainbow-csv code --install-extension mechatroner.rainbow-csv
code --install-extension grapecity.gc-excelviewer code --install-extension grapecity.gc-excelviewer
when: user_vscode == true
# VS Code - C/C++ Development Tools # VS Code - C/C++ Development Tools
- name: vscode - C/C++ - name: vscode - C/C++
when: user_vscode == true and user_lang_cpp == true
block: block:
- name: vscode - C/C++ - Configure VS Code - name: vscode - C/C++ - Configure VS Code
ansible.builtin.shell: | ansible.builtin.shell: |
@ -44,27 +45,27 @@
code --install-extension ms-vscode.cpptools code --install-extension ms-vscode.cpptools
code --install-extension ms-vscode.cmake-tools code --install-extension ms-vscode.cmake-tools
code --install-extension twxs.cmake code --install-extension twxs.cmake
when: user_vscode == true and user_lang_cpp == true
# VS Code - Python Development Tools # VS Code - Python Development Tools
- name: devel - Python - Install python dev packages - name: devel - Python - Install python dev packages
when: user_lang_python == true
ansible.builtin.pip: ansible.builtin.pip:
name: name:
- autopep8 - autopep8
# - pylint # must be installed in each venv individually! # - pylint # must be installed in each venv individually!
executable: "{{ override_pip_exe | default(default_pip3_exe) }}" executable: "{{ override_pip_exe | default(default_pip3_exe) }}"
when: user_lang_python == true
- name: vscode - Python - name: vscode - Python
when: user_vscode == true and user_lang_python == true
block: block:
- name: vscode - Python - Configure VS Code - name: vscode - Python - Configure VS Code
ansible.builtin.shell: | ansible.builtin.shell: |
PATH=/usr/local/bin:$PATH PATH=/usr/local/bin:$PATH
code --install-extension ms-python.python code --install-extension ms-python.python
when: user_vscode == true and user_lang_python == true
# VC Code - Golang Development Tools # VC Code - Golang Development Tools
# https://golang.org/doc/install # https://golang.org/doc/install
- name: devel - Golang - Setup Environment - name: devel - Golang - Setup Environment
when: user_lang_golang == true
block: block:
- name: devel - Golang - Create workspace directory - name: devel - Golang - Create workspace directory
ansible.builtin.file: ansible.builtin.file:
@ -88,30 +89,29 @@
backup: yes backup: yes
# TODO: make this resilient against changes # TODO: make this resilient against changes
# and group all golang stuff in one section inside zshrc-host # and group all golang stuff in one section inside zshrc-host
when: user_lang_golang == true
- name: vscode - Golang - name: vscode - Golang
when: user_vscode == true and user_lang_golang == true
block: block:
- name: vscode - Golang - Configure VS Code - name: vscode - Golang - Configure VS Code
ansible.builtin.shell: | ansible.builtin.shell: |
PATH=/usr/local/bin:$PATH PATH=/usr/local/bin:$PATH
code --install-extension golang.go code --install-extension golang.go
when: user_vscode == true and user_lang_golang == true
# VS Code - LaTeX Distribution # VS Code - LaTeX Distribution
- name: devel - LaTeX - Install TeX packages - name: devel - LaTeX - Install TeX packages
when: user_lang_latex == true
become: yes become: yes
ansible.builtin.shell: | ansible.builtin.shell: |
PATH=/Library/TeX/texbin:$PATH PATH=/Library/TeX/texbin:$PATH
tlmgr install latexmk latexindent biblatex logreq xstring biber tlmgr install latexmk latexindent biblatex logreq xstring biber
tlmgr install collection-fontsextra collection-fontsrecommended collection-fontutils collection-langgerman collection-langenglish collection-mathscience 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 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
when: user_lang_latex == true
- name: vscode - LaTeX - name: vscode - LaTeX
when: user_vscode == true and user_lang_latex == true
block: block:
- name: vscode - Basics - Configure - name: vscode - Basics - Configure
ansible.builtin.shell: | ansible.builtin.shell: |
PATH=/usr/local/bin:$PATH PATH=/usr/local/bin:$PATH
code --install-extension james-yu.latex-workshop code --install-extension james-yu.latex-workshop
code --install-extension ban.spellright code --install-extension ban.spellright
when: user_vscode == true and user_lang_latex == true

View file

@ -10,18 +10,18 @@
# if role has not changed, this will not be needed when just installing updates # if role has not changed, this will not be needed when just installing updates
- name: Install essential tools - name: Install essential tools
ansible.builtin.include_tasks: essentials.yml
when: common_settingsonly | default(false) == false when: common_settingsonly | default(false) == false
ansible.builtin.include_tasks: essentials.yml
# if role has not changed, this will not be needed when just installing updates # if role has not changed, this will not be needed when just installing updates
- name: Install more tools - name: Install more tools
ansible.builtin.include_tasks: tools.yml
when: common_settingsonly | default(false) == false when: common_settingsonly | default(false) == false
ansible.builtin.include_tasks: tools.yml
# this will just run once, because of a lock-file # this will just run once, because of a lock-file
- name: Basics - Setup user shell - name: Basics - Setup user shell
ansible.builtin.include_tasks: usersetup.yml
when: common_settingsonly | default(false) == false when: common_settingsonly | default(false) == false
ansible.builtin.include_tasks: usersetup.yml
# run this for every maintenance/ update cycle # run this for every maintenance/ update cycle
- name: Apply user settings - name: Apply user settings

View file

@ -3,14 +3,13 @@
- name: usersettings - Install required tools - name: usersettings - Install required tools
become: yes become: yes
when: (override_os_family is defined) | ternary(override_os_family,ansible_os_family) != "Darwin" ignore_errors: yes # just fail on systems without sudo access
ansible.builtin.package: ansible.builtin.package:
name: "{{ packages }}" name: "{{ packages }}"
state: present state: present
vars: vars:
packages: packages:
- git - git
- python3-pip
- name: usersettings - Install/ Update oh-my-zsh for current user - name: usersettings - Install/ Update oh-my-zsh for current user
ansible.builtin.git: ansible.builtin.git:
@ -23,32 +22,44 @@
dest: .fzf dest: .fzf
register: fzf_git register: fzf_git
- name: (Re-)Install fzf - name: (Re-)Install fzf
ansible.builtin.shell: ".fzf/install --key-bindings --no-completion --no-update-rc"
when: when:
- fzf_git.after != fzf_git.before - fzf_git.after != fzf_git.before
ansible.builtin.shell: ".fzf/install --key-bindings --no-completion --no-update-rc"
- name: usersettings - Install pip virtualenvwrapper - name: usersettings - Install pip virtualenvwrapper
when: usersetup_virtualenvwrapper
block: block:
- name: usersettings - Install pip3
when:
(override_os_family is defined) | ternary(override_os_family,ansible_os_family) != "Darwin" and
(override_os_family is defined) | ternary(override_os_family,ansible_os_family) != "FreeBSD"
become: yes
ignore_errors: yes # just fail on systems without sudo access
ansible.builtin.package:
name: "{{ packages }}"
state: present
vars:
packages:
- python3-pip
- name: usersettings - Install pip virtualenvwrapper (Debian) - name: usersettings - Install pip virtualenvwrapper (Debian)
when: (override_os_family is defined) | ternary(override_os_family,ansible_os_family) == "Debian"
become: yes become: yes
ansible.builtin.pip: ansible.builtin.pip:
name: virtualenvwrapper name: virtualenvwrapper
extra_args: --system extra_args: --system
when: (override_os_family is defined) | ternary(override_os_family,ansible_os_family) == "Debian"
- name: usersettings - Install pip virtualenvwrapper (macOS) - name: usersettings - Install pip virtualenvwrapper (macOS)
when: (override_os_family is defined) | ternary(override_os_family,ansible_os_family) == "Darwin"
environment: environment:
PATH: "/usr/local/bin:{{ ansible_env.PATH }}" PATH: "/usr/local/bin:{{ ansible_env.PATH }}"
ansible.builtin.pip: ansible.builtin.pip:
name: virtualenvwrapper name: virtualenvwrapper
when: (override_os_family is defined) | ternary(override_os_family,ansible_os_family) == "Darwin"
- name: usersettings - Install pip virtualenvwrapper (CentOS, ArchLinux) - name: usersettings - Install pip virtualenvwrapper (CentOS, ArchLinux)
become: yes
ansible.builtin.pip:
name: virtualenvwrapper
when: 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) == "Centos" or
(override_os_family is defined) | ternary(override_os_family,ansible_os_family) == "Archlinux" (override_os_family is defined) | ternary(override_os_family,ansible_os_family) == "Archlinux"
when: usersetup_virtualenvwrapper become: yes
ansible.builtin.pip:
name: virtualenvwrapper
- name: usersettings - Copy dotfiles - name: usersettings - Copy dotfiles
ansible.builtin.copy: ansible.builtin.copy:
src: "{{ item.src }}" src: "{{ item.src }}"
@ -68,10 +79,10 @@
src: "{{ role_path }}/templates/_zshrc.j2" src: "{{ role_path }}/templates/_zshrc.j2"
dest: "{{ ansible_user_dir }}/.zshrc" dest: "{{ ansible_user_dir }}/.zshrc"
- name: usersettings - Set global gitconfig - name: usersettings - Set global gitconfig
when: usersetup_gitconfig == true
ansible.builtin.template: ansible.builtin.template:
src: "{{ role_path }}/templates/_gitconfig.j2" src: "{{ role_path }}/templates/_gitconfig.j2"
dest: "{{ ansible_user_dir }}/.gitconfig" dest: "{{ ansible_user_dir }}/.gitconfig"
when: usersetup_gitconfig == true
- name: usersettings - Set tmux.conf - name: usersettings - Set tmux.conf
ansible.builtin.template: ansible.builtin.template:
src: "{{ role_path }}/templates/_tmux.conf.j2" src: "{{ role_path }}/templates/_tmux.conf.j2"

View file

@ -8,12 +8,12 @@
register: common_usersetup register: common_usersetup
- name: usersetup - Change login shell to zsh for current user - name: usersetup - Change login shell to zsh for current user
when:
- common_usersetup.stat.exists == false and usersetup_chsh == true
become: yes become: yes
ansible.builtin.user: ansible.builtin.user:
name: "{{ ansible_user_id }}" name: "{{ ansible_user_id }}"
shell: /bin/zsh shell: /bin/zsh
when:
- common_usersetup.stat.exists == false and usersetup_chsh == true
# TODO: adapt to ArchLinux systems, if needed # TODO: adapt to ArchLinux systems, if needed
# - name: usersetup - Install locales package # - name: usersetup - Install locales package
@ -23,23 +23,23 @@
# state: present # state: present
# - name: usersetup - Setup locale en_US # - name: usersetup - Setup locale en_US
# when:
# - common_usersetup.stat.exists == false
# become: yes # become: yes
# ansible.builtin.locale_gen: # ansible.builtin.locale_gen:
# name: en_US.UTF-8 # name: en_US.UTF-8
# state: present # state: present
# - name: usersetup - Setup locale de_DE
# when: # when:
# - common_usersetup.stat.exists == false # - common_usersetup.stat.exists == false
# - name: usersetup - Setup locale de_DE
# become: yes # become: yes
# ansible.builtin.locale_gen: # ansible.builtin.locale_gen:
# name: de_DE.UTF-8 # name: de_DE.UTF-8
# state: present # state: present
# when:
# - common_usersetup.stat.exists == false
- name: usersetup - Create lockfile - name: usersetup - Create lockfile
when:
- common_usersetup.stat.exists == false
ansible.builtin.file: ansible.builtin.file:
path: .ansbl-common-usersetup path: .ansbl-common-usersetup
state: touch state: touch
when:
- common_usersetup.stat.exists == false

View file

@ -8,12 +8,12 @@
register: common_usersetup register: common_usersetup
- name: usersetup - Change login shell to zsh for current user - name: usersetup - Change login shell to zsh for current user
when:
- common_usersetup.stat.exists == false and usersetup_chsh == true
become: yes become: yes
ansible.builtin.user: ansible.builtin.user:
name: "{{ ansible_user_id }}" name: "{{ ansible_user_id }}"
shell: /bin/zsh shell: /bin/zsh
when:
- common_usersetup.stat.exists == false and usersetup_chsh == true
# TODO: adapt to CentOS/ RHEL systems, if needed # TODO: adapt to CentOS/ RHEL systems, if needed
# - name: usersetup - Install locales package # - name: usersetup - Install locales package
@ -23,23 +23,23 @@
# state: present # state: present
# - name: usersetup - Setup locale en_US # - name: usersetup - Setup locale en_US
# when:
# - common_usersetup.stat.exists == false
# become: yes # become: yes
# ansible.builtin.locale_gen: # ansible.builtin.locale_gen:
# name: en_US.UTF-8 # name: en_US.UTF-8
# state: present # state: present
# - name: usersetup - Setup locale de_DE
# when: # when:
# - common_usersetup.stat.exists == false # - common_usersetup.stat.exists == false
# - name: usersetup - Setup locale de_DE
# become: yes # become: yes
# ansible.builtin.locale_gen: # ansible.builtin.locale_gen:
# name: de_DE.UTF-8 # name: de_DE.UTF-8
# state: present # state: present
# when:
# - common_usersetup.stat.exists == false
- name: usersetup - Create lockfile - name: usersetup - Create lockfile
when:
- common_usersetup.stat.exists == false
ansible.builtin.file: ansible.builtin.file:
path: .ansbl-common-usersetup path: .ansbl-common-usersetup
state: touch state: touch
when:
- common_usersetup.stat.exists == false

View file

@ -8,16 +8,16 @@
register: common_usersetup register: common_usersetup
- name: usersetup - Change login shell to zsh for current user - name: usersetup - Change login shell to zsh for current user
when:
- common_usersetup.stat.exists == false and usersetup_chsh == true
become: yes become: yes
ansible.builtin.user: ansible.builtin.user:
name: "{{ ansible_user_id }}" name: "{{ ansible_user_id }}"
shell: /bin/zsh shell: /bin/zsh
when:
- common_usersetup.stat.exists == false and usersetup_chsh == true
- name: usersetup - Create lockfile - name: usersetup - Create lockfile
when:
- common_usersetup.stat.exists == false
ansible.builtin.file: ansible.builtin.file:
path: .ansbl-common-usersetup path: .ansbl-common-usersetup
state: touch state: touch
when:
- common_usersetup.stat.exists == false

View file

@ -8,12 +8,12 @@
register: common_usersetup register: common_usersetup
- name: usersetup - Change login shell to zsh for current user - name: usersetup - Change login shell to zsh for current user
when:
- common_usersetup.stat.exists == false and usersetup_chsh == true
become: yes become: yes
ansible.builtin.user: ansible.builtin.user:
name: "{{ ansible_user_id }}" name: "{{ ansible_user_id }}"
shell: /bin/zsh shell: /bin/zsh
when:
- common_usersetup.stat.exists == false and usersetup_chsh == true
- name: usersetup - Install locales package - name: usersetup - Install locales package
become: yes become: yes
@ -22,23 +22,23 @@
state: present state: present
- name: usersetup - Setup locale en_US - name: usersetup - Setup locale en_US
when:
- common_usersetup.stat.exists == false
become: yes become: yes
ansible.builtin.locale_gen: ansible.builtin.locale_gen:
name: en_US.UTF-8 name: en_US.UTF-8
state: present state: present
- name: usersetup - Setup locale de_DE
when: when:
- common_usersetup.stat.exists == false - common_usersetup.stat.exists == false
- name: usersetup - Setup locale de_DE
become: yes become: yes
ansible.builtin.locale_gen: ansible.builtin.locale_gen:
name: de_DE.UTF-8 name: de_DE.UTF-8
state: present state: present
when:
- common_usersetup.stat.exists == false
- name: usersetup - Create lockfile - name: usersetup - Create lockfile
when:
- common_usersetup.stat.exists == false
ansible.builtin.file: ansible.builtin.file:
path: .ansbl-common-usersetup path: .ansbl-common-usersetup
state: touch state: touch
when:
- common_usersetup.stat.exists == false

View file

@ -8,12 +8,12 @@
register: common_usersetup register: common_usersetup
- name: usersetup - Change login shell to zsh for current user - name: usersetup - Change login shell to zsh for current user
when:
- common_usersetup.stat.exists == false and usersetup_chsh == true
become: yes become: yes
ansible.builtin.user: ansible.builtin.user:
name: "{{ ansible_user_id }}" name: "{{ ansible_user_id }}"
shell: /usr/local/bin/zsh shell: /usr/local/bin/zsh
when:
- common_usersetup.stat.exists == false and usersetup_chsh == true
# - name: usersetup - Install locales package # - name: usersetup - Install locales package
# become: yes # become: yes
@ -22,23 +22,23 @@
# state: present # state: present
# - name: usersetup - Setup locale en_US # - name: usersetup - Setup locale en_US
# when:
# - common_usersetup.stat.exists == false
# become: yes # become: yes
# ansible.builtin.locale_gen: # ansible.builtin.locale_gen:
# name: en_US.UTF-8 # name: en_US.UTF-8
# state: present # state: present
# - name: usersetup - Setup locale de_DE
# when: # when:
# - common_usersetup.stat.exists == false # - common_usersetup.stat.exists == false
# - name: usersetup - Setup locale de_DE
# become: yes # become: yes
# ansible.builtin.locale_gen: # ansible.builtin.locale_gen:
# name: de_DE.UTF-8 # name: de_DE.UTF-8
# state: present # state: present
# when:
# - common_usersetup.stat.exists == false
- name: usersetup - Create lockfile - name: usersetup - Create lockfile
when:
- common_usersetup.stat.exists == false
ansible.builtin.file: ansible.builtin.file:
path: .ansbl-common-usersetup path: .ansbl-common-usersetup
state: touch state: touch
when:
- common_usersetup.stat.exists == false

View file

@ -1,7 +1,7 @@
{% if gitconfig_name is defined and gitconfig_email is defined %} {% if gitconfig_name is defined and gitconfig_email is defined %}
[user] [user]
name = {{ gitconfig_name }} name = {{ gitconfig_name }}
email = {{ gitconfig_email }} email = {{ gitconfig_email }}
{% endif %} {% endif %}
[core] [core]
excludesfile = ~/.gitignore_global excludesfile = ~/.gitignore_global