Ansible role to provision a zone on OpenIndiana
Olaf Bohlen
2020-08-19 3ada41b2e02817175192ac3e44f261ee76993a66
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
setup_timezone "{{ oizone['sysding']['timezone'] }}"
setup_locale "{{ oizone['sysding']['locale'] }}"
{% if oizone['sysding']['nfs4domain'] %}
setup_nfs4domain "{{ oizone['sysding']['nfs4domain'] }}"
{% endif %}
 
{% for user in oizone['sysding']['users'] %}
{% if user['name'] != "root" %}
setup_user_account {{ user['name'] }} {{ user['uid'] }} {{ user['gid'] }} {{ user['gecos'] }} {{ user['home'] }} {{ user['shell'] }}
mkdir -p {{ user['home'] }}
chmod {{ user['name'] }}:{{ user['gid'] }} {{ user['home'] }}
{% endif %}
setup_user_password {{ user['name'] }} '{{ user["hashedpassword"] }}'
{% endfor %}
{% if oizone['iptype'] == "exclusive-ip" %}
{% for nic in oizone['nics'] %}
setup_interface {{ nic['logical'] }} {{ nic['addrsuffix'] }} {{ nic['address'] }}
{% endfor %}
{% endif %}
 
{% for route in oizone['sysding']['ip']['routes'] %}
setup_route {{ route['target'] }} {{ route['router'] }}
{% endfor %}
 
{% if oizone['sysding']['dns'] %}
setup_ns_dns "{{ oizone['sysding']['dns']['domain'] }}" "{{ oizone['sysding']['dns']['search'] | join(' ') }}" "{{ oizone['sysding']['dns']['nameservers'] | join(' ') }}"
{% endif %}