-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Allow to exclude dotfiles on pillar data
- Loading branch information
1 parent
7e2502b
commit f827d1b
Showing
14 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
<!-- | ||
SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. <[email protected]> | ||
SPDX-FileCopyrightText: 2024 seven-beep <[email protected]> | ||
SPDX-License-Identifier: CC-BY-SA-4.0 | ||
--> | ||
|
@@ -13,6 +14,7 @@ Dotfiles. | |
* [Description](#description) | ||
* [Installation](#installation) | ||
* [Salt](#salt) | ||
* [Pillar](#pillar) | ||
* [Script](#script) | ||
* [Usage](#usage) | ||
* [License](#license) | ||
|
@@ -59,6 +61,31 @@ Install specific files in Dom0: | |
sudo qubesctl state.apply dotfiles.copy-dom0,dotfiles.copy-sh,dotfiles.copy-vim,dotfiles.copy-x11 | ||
``` | ||
|
||
#### Pillar | ||
|
||
With Salt, the execution of each state can be opt out via the dotfiles pillar. | ||
You will need a top and a sls file in your pillar_roots (default to /srv/pillar, | ||
/srv/pillar/base, can be configured in /etc/salt/minion.d). | ||
|
||
Exemple: /srv/pillar/qusal/dotfiles.top to apply the dotfiles sls to all targets: | ||
```yaml | ||
base: | ||
'*': | ||
- qusal.dotfiles | ||
``` | ||
Exemple: /srv/pillar/dotfiles.sls containing the data to pass to the targets: | ||
```yaml | ||
qusal: | ||
dotfiles: | ||
all: true # This is the default. use 'false' to disable all states. | ||
dom0: false # Setting dotfiles:dom0 to 'false' will disable copy-dom0 state. | ||
``` | ||
Enable it: | ||
```sh | ||
sudo qubesclt top.enable qusal.dotfiles pillar=true | ||
``` | ||
Now subsequent calls to the states of this repository will skip copy-dom0. | ||
|
||
### Script | ||
|
||
You can simply deploy all configurations with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
{# | ||
SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. <[email protected]> | ||
SPDX-FileCopyrightText: 2024 seven-beep <[email protected]> | ||
|
||
SPDX-License-Identifier: AGPL-3.0-or-later | ||
#} | ||
|
||
{%- if salt['pillar.get']('qusal:dotfiles:all', default=true) == true -%} | ||
|
||
include: | ||
- .copy-dom0 | ||
- .copy-git | ||
|
@@ -17,6 +20,8 @@ include: | |
- .copy-x11 | ||
- .copy-xfce | ||
|
||
{%- endif -%} | ||
|
||
{# | ||
Unfortunately salt.states.file does not keep permissions when using salt-ssh. | ||
Best option is 'file.managed mode: keep' or 'file.recurse file_mode: keep'. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
{# | ||
SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. <[email protected]> | ||
SPDX-FileCopyrightText: 2024 seven-beep <[email protected]> | ||
|
||
SPDX-License-Identifier: AGPL-3.0-or-later | ||
#} | ||
|
||
{%- if ( (salt['pillar.get']('qusal:dotfiles:all', default=true) == true ) | ||
and (salt['pillar.get']('qusal:dotfiles:dom0', default=true) == true )) -%} | ||
|
||
{%- import "dom0/gui-user.jinja" as gui_user -%} | ||
"{{ slsdotpath }}-copy-dom0-home": | ||
|
@@ -25,3 +29,5 @@ SPDX-License-Identifier: AGPL-3.0-or-later | |
- user: root | ||
- group: root | ||
- makedirs: True | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
{# | ||
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <[email protected]> | ||
SPDX-FileCopyrightText: 2024 seven-beep <[email protected]> | ||
|
||
SPDX-License-Identifier: AGPL-3.0-or-later | ||
#} | ||
|
||
{%- if ( (salt['pillar.get']('qusal:dotfiles:all', default=true) == true ) | ||
and (salt['pillar.get']('qusal:dotfiles:git', default=true) == true )) -%} | ||
|
||
{%- import "dom0/gui-user.jinja" as gui_user -%} | ||
"{{ slsdotpath }}-copy-git-home": | ||
|
@@ -65,3 +69,5 @@ SPDX-License-Identifier: AGPL-3.0-or-later | |
- mode: '0755' | ||
- recurse: | ||
- mode | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
{# | ||
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <[email protected]> | ||
SPDX-FileCopyrightText: 2024 seven-beep <[email protected]> | ||
|
||
SPDX-License-Identifier: AGPL-3.0-or-later | ||
#} | ||
|
||
{%- if ( (salt['pillar.get']('qusal:dotfiles:all', default=true) == true ) | ||
and (salt['pillar.get']('qusal:dotfiles:gtk', default=true) == true )) -%} | ||
|
||
{%- import "dom0/gui-user.jinja" as gui_user -%} | ||
"{{ slsdotpath }}-copy-gtk-home": | ||
|
@@ -23,3 +27,5 @@ SPDX-License-Identifier: AGPL-3.0-or-later | |
- dir_mode: '0700' | ||
- user: root | ||
- group: root | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
{# | ||
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <[email protected]> | ||
SPDX-FileCopyrightText: 2024 seven-beep <[email protected]> | ||
|
||
SPDX-License-Identifier: AGPL-3.0-or-later | ||
#} | ||
|
||
{%- if ( (salt['pillar.get']('qusal:dotfiles:all', default=true) == true ) | ||
and (salt['pillar.get']('qusal:dotfiles:mutt', default=true) == true )) -%} | ||
|
||
{%- import "dom0/gui-user.jinja" as gui_user -%} | ||
"{{ slsdotpath }}-copy-mutt-home": | ||
|
@@ -25,3 +29,5 @@ SPDX-License-Identifier: AGPL-3.0-or-later | |
- user: root | ||
- group: root | ||
- makedirs: True | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
{# | ||
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <[email protected]> | ||
SPDX-FileCopyrightText: 2024 seven-beep <[email protected]> | ||
|
||
SPDX-License-Identifier: AGPL-3.0-or-later | ||
#} | ||
|
||
{%- if ( (salt['pillar.get']('qusal:dotfiles:all', default=true) == true ) | ||
and (salt['pillar.get']('qusal:dotfiles:net', default=true) == true )) -%} | ||
|
||
{%- import "dom0/gui-user.jinja" as gui_user -%} | ||
"{{ slsdotpath }}-copy-net-home": | ||
|
@@ -27,3 +31,5 @@ SPDX-License-Identifier: AGPL-3.0-or-later | |
- group: root | ||
- keep_symlinks: True | ||
- force_symlinks: True | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
{# | ||
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <[email protected]> | ||
SPDX-FileCopyrightText: 2024 seven-beep <[email protected]> | ||
|
||
SPDX-License-Identifier: AGPL-3.0-or-later | ||
#} | ||
|
||
{%- if ( (salt['pillar.get']('qusal:dotfiles:all', default=true) == true ) | ||
and (salt['pillar.get']('qusal:dotfiles:gpg', default=true) == true )) -%} | ||
|
||
{%- import "dom0/gui-user.jinja" as gui_user -%} | ||
"{{ slsdotpath }}-copy-pgp-home": | ||
|
@@ -23,3 +27,5 @@ SPDX-License-Identifier: AGPL-3.0-or-later | |
- dir_mode: '0700' | ||
- user: root | ||
- group: root | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
{# | ||
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <[email protected]> | ||
SPDX-FileCopyrightText: 2024 seven-beep <[email protected]> | ||
|
||
SPDX-License-Identifier: AGPL-3.0-or-later | ||
#} | ||
|
||
{%- if ( (salt['pillar.get']('qusal:dotfiles:all', default=true) == true ) | ||
and (salt['pillar.get']('qusal:dotfiles:gpg', default=true) == true )) -%} | ||
|
||
{%- import "dom0/gui-user.jinja" as gui_user -%} | ||
"{{ slsdotpath }}-copy-sh-home": | ||
|
@@ -43,3 +47,5 @@ SPDX-License-Identifier: AGPL-3.0-or-later | |
- dir_mode: '0755' | ||
- recurse: | ||
- mode | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
{# | ||
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <[email protected]> | ||
SPDX-FileCopyrightText: 2024 seven-beep <[email protected]> | ||
|
||
SPDX-License-Identifier: AGPL-3.0-or-later | ||
#} | ||
|
||
{%- if ( (salt['pillar.get']('qusal:dotfiles:all', default=true) == true ) | ||
and (salt['pillar.get']('qusal:dotfiles:ssh', default=true) == true )) -%} | ||
|
||
{%- import "dom0/gui-user.jinja" as gui_user -%} | ||
"{{ slsdotpath }}-copy-ssh-home": | ||
|
@@ -24,3 +28,5 @@ SPDX-License-Identifier: AGPL-3.0-or-later | |
- dir_mode: '0700' | ||
- user: root | ||
- group: root | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
{# | ||
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <[email protected]> | ||
SPDX-FileCopyrightText: 2024 seven-beep <[email protected]> | ||
|
||
SPDX-License-Identifier: AGPL-3.0-or-later | ||
#} | ||
|
||
{%- if ( (salt['pillar.get']('qusal:dotfiles:all', default=true) == true ) | ||
and (salt['pillar.get']('qusal:dotfiles:tmux', default=true) == true )) -%} | ||
|
||
{%- import "dom0/gui-user.jinja" as gui_user -%} | ||
"{{ slsdotpath }}-copy-tmux-home": | ||
|
@@ -37,3 +41,5 @@ SPDX-License-Identifier: AGPL-3.0-or-later | |
- mode: '0755' | ||
- recurse: | ||
- mode | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
{# | ||
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <[email protected]> | ||
SPDX-FileCopyrightText: 2024 seven-beep <[email protected]> | ||
|
||
SPDX-License-Identifier: AGPL-3.0-or-later | ||
#} | ||
|
||
{%- if ( (salt['pillar.get']('qusal:dotfiles:all', default=true) == true ) | ||
and (salt['pillar.get']('qusal:dotfiles:vim', default=true) == true )) -%} | ||
|
||
{%- import "dom0/gui-user.jinja" as gui_user -%} | ||
"{{ slsdotpath }}-copy-vim-home": | ||
|
@@ -23,3 +27,5 @@ SPDX-License-Identifier: AGPL-3.0-or-later | |
- dir_mode: '0700' | ||
- user: root | ||
- group: root | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
{# | ||
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <[email protected]> | ||
SPDX-FileCopyrightText: 2024 seven-beep <[email protected]> | ||
|
||
SPDX-License-Identifier: AGPL-3.0-or-later | ||
#} | ||
|
||
{%- if ( (salt['pillar.get']('qusal:dotfiles:all', default=true) == true ) | ||
and (salt['pillar.get']('qusal:dotfiles:dom0', default=true) == true )) -%} | ||
|
||
{%- import "dom0/gui-user.jinja" as gui_user -%} | ||
"{{ slsdotpath }}-copy-x11-home": | ||
|
@@ -27,3 +31,5 @@ SPDX-License-Identifier: AGPL-3.0-or-later | |
- group: root | ||
- keep_symlinks: True | ||
- force_symlinks: True | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
{# | ||
SPDX-FileCopyrightText: 2024 Benjamin Grande M. S. <[email protected]> | ||
SPDX-FileCopyrightText: 2024 seven-beep <[email protected]> | ||
|
||
SPDX-License-Identifier: AGPL-3.0-or-later | ||
#} | ||
|
||
{%- if ( (salt['pillar.get']('qusal:dotfiles:all', default=true) == true ) | ||
and (salt['pillar.get']('qusal:dotfiles:xfce', default=true) == true )) -%} | ||
|
||
{%- import "dom0/gui-user.jinja" as gui_user -%} | ||
"{{ slsdotpath }}-copy-xfce-home": | ||
|
@@ -27,3 +31,5 @@ SPDX-License-Identifier: AGPL-3.0-or-later | |
- group: root | ||
- keep_symlinks: True | ||
- force_symlinks: True | ||
{%- endif %} |