On 2020-05-17 17:08, unman wrote:
On Sun, May 17, 2020 at 09:55:00AM +0100, [email protected] 
wrote:


You haven't included AppVmTobeChanged as a target:
qubesctl --show-output --targets=AppVmTobeChanged state.highstate

You should check that you aren't getting a mistaken dom0 call.


That made the trick. Thanks unman!

One step forward, but still a way to go:
Currently I'm struggling to use pillars in my scripts. I have my scripts in
/srv/salt/user_salt
/srv/salt/user_pillar

Trying to enable a script containing some constants doesn't work because they 
cannot be found.
The only way to use pillars for me is passing them at the command line:
qubesctl ... pillar='{"name": "value"}'

But in this case I get errors in some scripts like this:
TypeError encountered executing state.highstate: highstate() takes from 0 to 1 
positional arguments but 2 were given

after executing this commandline:
sudo qubesctl --show-output --target AppVmTobeChanged state.highstate pillar='{"name": 
"value"}'


Best case I'd manage to include pillars in my scripts. Any ideas how?


Can you post examples of the pillars you have written?
What exactly are you trying to do?


My current goal is to automate the update of a fedora template as soon as a new 
one is available.
I'm trying to achieve this by these steps:
1. creating a clone of the default template
2. update this template with packages for a special purpose template

Details:
I created a top file like this:

-------- /srv/salt/user_salt/create_my_special_purpose_template.top --------
base:
 dom0:
  - match: nodegroup
  - user_salt.create-template-clone

 't-fedora-*-template-clone':
  - user_salt.install-pkgs-for-special-purpose-template

-------- /srv/salt/user_salt/create_my_special_purpose_template.top --------

1. creating a clone of the default template is done by this file
-------- /srv/salt/user_salt/create-template-clone.sls --------
create-template-clone:
 qvm.clone:
  - name: t-fedora-{{ pillar['version'] }}-special-purpose-template
  - source: fedora-{{ pillar['version'] }}-minimal

-------- /srv/salt/user_salt/create-template-clone.sls --------

2. update this template with packages for a special purpose template
-------- /srv/salt/user_salt/install-pkgs-for-special-purpose-template.sls 
--------
install-packages:
 pkg.installed:
  - pkgs:
    - nano
  - refresh: True
-------- /srv/salt/user_salt/install-pkgs-for-special-purpose-template.sls 
--------

In step 2 I'm trying to use pillars to be less dependent from the fedora 
version.

When I'm running the command:
sudo qubesctl --show-output --target t-fedora-31-template-clone state.highstate 
pillar='{"version": "31"}'

I get the error:
TypeError encountered executing state.highstate: highstate() takes from 0 to 1 
positional arguments but 2 were given

That's why I'm trying to include pillars at least as a file, but don't manage 
to include them, so that they could by used by step 1.


Thank you very much by reading this long story... :) And if you've suggestion 
to solve it I even more appreciate it. :))

--
You received this message because you are subscribed to the Google Groups 
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-users/2466f4d6-de4b-d4bb-1a3c-766fe97ecde5%40gmx.de.

Reply via email to