Skip to content

Commit debe65a

Browse files
doczkalCendioOssman
authored andcommitted
Dash to underscore in inventory/hosts files
Dashes are not allowed in inventory/hosts ini files. Replace dash with underscore.
1 parent 85cfa14 commit debe65a

3 files changed

Lines changed: 16 additions & 16 deletions

File tree

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,30 +97,30 @@ requirements.yml` to install the role:
9797
version: v1.1
9898
```
9999

100-
The role uses three groups - thinlinc-masters, thinlinc-agents and
100+
The role uses three groups - thinlinc_masters, thinlinc_agents and
101101
thinlinc-servers. Here's an example inventory file with one master
102102
server and three agent servers:
103103

104104
```yaml
105-
[thinlinc-masters]
105+
[thinlinc_masters]
106106
tl-master-01.example.com
107107
108-
[thinlinc-agents]
108+
[thinlinc_agents]
109109
tl-agent-01.example.com
110110
tl-agent-02.example.com
111111
tl-agent-03.example.com
112112
113-
[thinlinc-servers:children]
114-
thinlinc-masters
115-
thinlinc-agents
113+
[thinlinc_servers:children]
114+
thinlinc_masters
115+
thinlinc_agents
116116
```
117117

118118
Now that we got both a role and an inventory, connect the dots by
119-
applying the thinlinc-server role to the thinlinc-servers group with a
119+
applying the thinlinc-server role to the thinlinc_servers group with a
120120
`thinlinc.yml` playbook:
121121

122122
```yaml
123-
- hosts: thinlinc-servers
123+
- hosts: thinlinc_servers
124124
roles:
125125
- { role: thinlinc-server, thinlinc_accept_eula: "yes" }
126126
```

tasks/main.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,25 @@
4545
param: /vsmagent/agent_hostname
4646
value: "{{ thinlinc_agent_hostname or ansible_fqdn }}"
4747
notify: restart vsmagent
48-
when: "'thinlinc-agents' in group_names"
48+
when: "'thinlinc_agents' in group_names"
4949

5050
- name: Configure /vsmagent/master_hostname
5151
tlconfig:
5252
param: /vsmagent/master_hostname
53-
value: "{{ groups['thinlinc-masters'][0] or 'localhost' }}"
53+
value: "{{ groups['thinlinc_masters'][0] or 'localhost' }}"
5454
notify: restart vsmagent
55-
when: "'thinlinc-agents' in group_names"
55+
when: "'thinlinc_agents' in group_names"
5656

5757
- name: Configure /vsmagent/allowed_clients
5858
tlconfig:
5959
param: /vsmagent/allowed_clients
60-
value: "{{ ' '.join(groups['thinlinc-masters']) or 'localhost' }}"
60+
value: "{{ ' '.join(groups['thinlinc_masters']) or 'localhost' }}"
6161
notify: restart vsmagent
62-
when: "'thinlinc-agents' in group_names"
62+
when: "'thinlinc_agents' in group_names"
6363

6464
- name: Configure list of agent servers
6565
tlconfig:
6666
param: /vsmserver/subclusters/Default/agents
67-
value: "{{ ' '.join(groups['thinlinc-agents']) or 'localhost' }}"
67+
value: "{{ ' '.join(groups['thinlinc_agents']) or 'localhost' }}"
6868
notify: restart vsmserver
69-
when: "'thinlinc-masters' in group_names"
69+
when: "'thinlinc_masters' in group_names"

templates/thinlinc-setup.answers.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ setup-firewall=yes
66
setup-selinux=yes
77
setup-web-integration=yes
88
setup-apparmor=yes
9-
{% if ansible_fqdn in groups['thinlinc-masters'] %}
9+
{% if ansible_fqdn in groups['thinlinc_masters'] %}
1010
server-type=master
1111
{% else %}
1212
server-type=agent

0 commit comments

Comments
 (0)