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