-
We have a salt state for tigervnc server on RHEL 8 & 9. I don't like how it is set up because the vncserver.users and /etc/systemd/system/'vncserver@:2.service' are all explicitly defined in the salt state. I was thinking we could put the user and port list in a map file and then create from that. However, I'm not sure I understand the map syntax correctly. FYI, the vncserver.users file looks like:
and for every number in the above file, you create in /etc/systemd/system a systemd start script named: 'vncserver@:2.service' for example. I want to remove the association of port numbers and sids from the state file. If anyone has suggestions, I'd love to hear it |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You can just create a users.yaml file and import it with users.yaml: 2: sid1
3: sid2
17: sid3
|
Beta Was this translation helpful? Give feedback.
-
Thanks! I will give that a try!
…On Fri, Oct 4, 2024 at 2:11 PM bdrx312 ***@***.***> wrote:
You can just create a users.yaml file and import it with import_yaml
users.yaml:
2: sid13: sid217: sid3
# import your yaml data ...
{% import_yaml "users.yaml" as users %}
# now you can use it something like...
{%- for port, sid in users.items() %}
"/etc/systemd/system/vncserver@:{{ port }}.service"
file.managed:
- user: root
- group: root
- mode: '0644'
- source: "salt://{{ tpldir }}/etc/systemd/system/vncserver.service.j2"
- template: jinja
- context:
sid: "{{ sid }}"
{% endfor %}
—
Reply to this email directly, view it on GitHub
<#66938 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMRXQR3QJF3UDSJEGDS4773ZZ3K33AVCNFSM6AAAAABPDL4NP6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTAOBUG42DIOA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
You can just create a users.yaml file and import it with
import_yaml
users.yaml: