[FIX] add common_settingsonly flag to role as well

This commit is contained in:
Jannik Beyerstedt 2019-10-31 18:29:35 +01:00
parent cb3f6cdf7a
commit c37ae1742c
4 changed files with 24 additions and 10 deletions

View file

@ -30,6 +30,8 @@ For a GUI/ Desktop machine, you can enable to install and configure VS Code:
The `user_lang_*` switches will also install the language only, if `user_vscode` is set to false. The `user_lang_*` switches will also install the language only, if `user_vscode` is set to false.
To install just the dotfiles, set `common_settingsonly` to true.
Dependencies Dependencies
------------ ------------
@ -50,31 +52,37 @@ You can simply run the whole role:
import_role: import_role:
name: common name: common
tasks_from: update tasks_from: update
when: common_settingsonly | default(false) == false
- name: Basics - Install essential tools - name: Basics - Install essential tools
import_role: import_role:
name: common name: common
tasks_from: essentials tasks_from: essentials
when: common_settingsonly | default(false) == false
- name: Basics - Install more tools - name: Basics - Install more tools
import_role: 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
import_role: 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
import_role: import_role:
name: common name: common
tasks_from: usersettings tasks_from: usersettings
# just for you main machine (not included in the role's main.yml) # Additional Tasks for Specific Host Types (not included in the role's main.yml)
# more tools for your main machine
- name: Basics - Install user's working utilities - name: Basics - Install user's working utilities
import_role: import_role:
name: common name: common
tasks_from: usertools tasks_from: usertools
# (not included in the role's main.yml) # install programming languages and optionally VS Code
- name: Basics - Install and configure VS Code - name: Basics - Install and configure VS Code
import_role: import_role:
name: common name: common
@ -87,9 +95,8 @@ Or call the different tasks individually:
hosts: all hosts: all
strategy: free strategy: free
tasks: tasks:
- name: Basics - Update first - import_role:
roles: name: common
- common
``` ```

View file

@ -1,6 +1,9 @@
--- ---
# defaults file for common # defaults file for common
# just copy dotfiles (for foreign hosts like webhosting)
common_settingsonly: false
# change login shell # change login shell
usersetup_chsh: true usersetup_chsh: true

@ -1 +1 @@
Subproject commit e70885ae15e32de67ca259e304516237663a5e92 Subproject commit 93673888bb177052a8b7f993c05e4c29d3b86c7a

View file

@ -9,21 +9,25 @@
# - Some must run periodically # - Some must run periodically
- name: Install updates - name: Install updates
import_tasks: update.yml include_tasks: update.yml
when: common_settingsonly == false
# 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
import_tasks: essentials.yml include_tasks: essentials.yml
when: common_settingsonly == false
# 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
import_tasks: tools.yml include_tasks: tools.yml
when: common_settingsonly == false
# 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
import_tasks: usersetup.yml include_tasks: usersetup.yml
when: common_settingsonly == false
# run this for every maintenance/ update cycle # run this for every maintenance/ update cycle
- name: Apply user settings - name: Apply user settings