You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This role requires the dictionary `sap_maintain_etc_hosts_list` which contains the parameters for the `/etc/hosts` file.
97
100
98
101
The default value is the definition of the cluster nodes like in the role [sap_ha_pacemaker_cluster](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_ha_pacemaker_cluster).</br>
99
-
If the value `sap_hana_cluster_nodes`or `sap_ha_pacemaker_cluster_cluster_nodes` is not defined, then the role creates a default value from `ansible_facts`.
102
+
If the value `sap_hana_cluster_nodes`or `sap_ha_pacemaker_cluster_cluster_nodes` is not defined, then the role expects valid `sap_maintain_etc_hosts_list`.
100
103
101
-
**NOTE: If you want to use this role to remove entries from /etc/hosts it is a good practice to do this before adding entries. The adding/removal is done in the order the entries are listed.**
104
+
**NOTE: If you want to use this role to remove entries from /etc/hosts it is a good practice to do this before adding entries.**<br>
105
+
**The adding/removal is done in the order the entries are listed.**
102
106
103
107
### sap_maintain_etc_hosts_list
104
-
105
108
- _Type:_ `list` with elements of type `dict`
106
109
107
110
Mandatory list of nodes in form of dictionaries to be added or removed in `/etc/hosts` file.
108
111
109
112
Following dictionary keys can be defined:
110
113
111
114
- **node_ip**<br>
112
-
IP address of the managed node.<br>
113
-
**Required** for adding new entries to `/etc/hosts`.</br>
114
-
_Optional_ for removing entries, where `node_name` and `node_domain` can be used instead.
115
-
116
115
- _Type:_ `string`
117
116
118
-
- **node_name**<br>
119
-
Hostname of the managed node.<br>
120
-
**Required** for adding new entries to `/etc/hosts`.</br>
121
-
_Optional_ for removing entries, when `node_ip` is not used.
117
+
IP address of the host to manage, depending on `state`.<br>
118
+
**Required** for `state: present`.</br>
119
+
_Optional_ for `state: absent`, where `node_name` and `node_domain` can be used instead.
122
120
121
+
- **node_name**<br>
123
122
- _Type:_ `string`
124
123
125
-
- **node_domain**<br>
126
-
Domain name of the managed node. Defaults to `sap_domain` if set or `ansible_facts['domain']`.<br>
127
-
**Required** for adding new entries to `/etc/hosts`.</br>
128
-
_Optional_ for removing entries, when `node_name` is used.
124
+
Hostname of the host to manage.<br>
125
+
**Required** for `state: present`.</br>
126
+
_Optional_ for `state: absent`, where `node_ip` can be used instead.
_Optional_ for adding new entries to `/etc/hosts`.
132
+
Domain name of the host to manage.<br>
133
+
Defaults to `sap_maintain_etc_hosts_domain` or `ansible_facts['domain']`.<br>
134
+
**Required** for `state: present`.</br>
135
+
_Optional_ for `state: absent` with `node_name`, where `node_ip` can be used instead.
136
136
137
+
- **aliases**<br>
137
138
- _Type:_ `list` with elements of type `string`
138
139
139
-
- **alias_mode**<br>
140
-
Select method of updating `/etc/hosts` file:<br>
141
-
- `merge` : merges the list of aliases with the exiting aliases of the node.<br>
142
-
- `overwrite` : overwrites the aliases of the node.
143
-
_Optional_ for adding new entries to `/etc/hosts`.
140
+
List of aliases of the host to manage.<br>
141
+
_Optional_ for `state: present`.<br>
142
+
Not used in `state: absent`.
144
143
144
+
- **alias_mode**<br>
145
145
- _Type:_ `string`
146
146
- _Default:_ `merge`
147
147
148
-
- **node_comment**<br>
149
-
Node comment is appended at end of line of managed node.<br>
150
-
_Optional_ for adding new entries to `/etc/hosts`.
148
+
Select method of managing aliases of the host.
149
+
150
+
- `merge`- merges the list of aliases with the exiting aliases of the host.
151
+
- `overwrite`- overwrites the aliases of the host.
151
152
153
+
_Optional_ for `state: present`.<br>
154
+
Not used in `state: absent`.
155
+
156
+
- **node_comment**<br>
152
157
- _Type:_ `string`
153
158
- _Default:_ `managed by ansible sap_maintain_etc_hosts role`
154
159
155
-
- **hana_site**<br>
156
-
Used by [sap_ha_pacemaker_cluster](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_ha_pacemaker_cluster) and it is appended to `node_comment`<br>
157
-
_Optional_ for adding new entries to `/etc/hosts`.
160
+
String which is appended at end of line of the host to manage.<br>
161
+
Replaces existing comment, if present.<br>
162
+
_Optional_ for `state: present`.<br>
163
+
Not used in `state: absent`.
158
164
165
+
- **hana_site**<br>
159
166
- _Type:_ `string`
160
167
161
-
- **node_role**<br>
162
-
Not used, but mentioned for compatibility reasons for [sap_ha_pacemaker_cluster](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_ha_pacemaker_cluster) role.<br>
168
+
Used by [sap_ha_pacemaker_cluster](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_ha_pacemaker_cluster) role and it is appended to `node_comment`<br>
169
+
_Optional_ for `state: present`.<br>
170
+
Not used in `state: absent`.
163
171
172
+
- **node_role**<br>
164
173
- _Type:_ `string`
165
174
166
-
- **state**<br>
167
-
Select `present` for adding new entries, `absent` for removing them.<br>
168
-
**Required** for removing entries, otherwise default `present` is used.
175
+
Not used, but mentioned for compatibility reasons with [sap_ha_pacemaker_cluster](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_ha_pacemaker_cluster) role.<br>
169
176
177
+
- **state**<br>
170
178
- _Type:_ `string`
171
179
- _Default:_ `present`
180
+
181
+
Select desired state of host item.
182
+
183
+
- `present`- Add new hosts entry.
184
+
- `absent`- Remove existing hosts entry.
185
+
186
+
_Optional_ for `state: present`.<br>
187
+
**Required** for `state: absent`, because it defaults to `present`.</br>
188
+
189
+
### sap_maintain_etc_hosts_delimiter
190
+
- _Type:_ `str`
191
+
- _Default:_ `' '`
192
+
- _Choices:_ `' ', '/t'`
193
+
194
+
Delimiter for `/etc/hosts` used to separate all elements on a line.</br>
195
+
Changing delimiter will report as change, even if actual content did not change.</br>
196
+
197
+
### sap_maintain_etc_hosts_comment
198
+
- _Type:_ `str`
199
+
- _Default:_ `managed by Ansible role sap_maintain_etc_hosts`
200
+
201
+
Comment to be appended, if comment is not defined in `sap_maintain_etc_hosts_list`.
0 commit comments