community / community.general / 8.5.0 / module / solaris_zone Manage Solaris zones Authors: Paul Markham (@pmarkham)community.general.solaris_zone (8.5.0) — module
Install with ansible-galaxy collection install community.general:==8.5.0
collections: - name: community.general version: 8.5.0
Create, start, stop and delete Solaris zones.
This module does not currently allow changing of options for a zone that is already been created.
- name: Create and install a zone, but don't boot it community.general.solaris_zone: name: zone1 state: present path: /zones/zone1 sparse: true root_password: Be9oX7OSwWoU. config: 'set autoboot=true; add net; set physical=bge0; set address=10.1.1.1; end'
- name: Create and install a zone and boot it community.general.solaris_zone: name: zone1 state: running path: /zones/zone1 root_password: Be9oX7OSwWoU. config: 'set autoboot=true; add net; set physical=bge0; set address=10.1.1.1; end'
- name: Boot an already installed zone community.general.solaris_zone: name: zone1 state: running
- name: Stop a zone community.general.solaris_zone: name: zone1 state: stopped
- name: Destroy a zone community.general.solaris_zone: name: zone1 state: absent
- name: Detach a zone community.general.solaris_zone: name: zone1 state: detached
- name: Configure a zone, ready to be attached community.general.solaris_zone: name: zone1 state: configured path: /zones/zone1 root_password: Be9oX7OSwWoU. config: 'set autoboot=true; add net; set physical=bge0; set address=10.1.1.1; end'
- name: Attach zone1 community.general.solaris_zone: name: zone1 state: attached attach_options: -u
name: description: - Zone name. - A zone name must be unique name. - A zone name must begin with an alphanumeric character. - The name can contain alphanumeric characters, underscores V(_), hyphens V(-), and periods V(.). - The name cannot be longer than 64 characters. required: true type: str path: description: - The path where the zone will be created. This is required when the zone is created, but not used otherwise. type: str state: choices: - absent - attached - configured - detached - installed - present - running - started - stopped default: present description: - V(present), configure and install the zone. - V(installed), synonym for V(present). - V(running), if the zone already exists, boot it, otherwise, configure and install the zone first, then boot it. - V(started), synonym for V(running). - V(stopped), shutdown a zone. - V(absent), destroy the zone. - V(configured), configure the ready so that it's to be attached. - V(attached), attach a zone, but do not boot it. - V(detached), shutdown and detach a zone type: str config: default: '' description: - The zonecfg configuration commands for this zone. See zonecfg(1M) for the valid options and syntax. Typically this is a list of options separated by semi-colons or new lines, e.g. "set auto-boot=true;add net;set physical=bge0;set address=10.1.1.1;end" type: str sparse: default: false description: - Whether to create a sparse (V(true)) or whole root (V(false)) zone. type: bool timeout: default: 600 description: - Timeout, in seconds, for zone to boot. type: int root_password: description: - The password hash for the root account. If not specified, the zone's root account will not have a password. type: str attach_options: default: '' description: - Extra options to the zoneadm attach command. For example, this can be used to specify whether a minimum or full update of packages is required and if any packages need to be deleted. For valid values, see zoneadm(1M) type: str create_options: default: '' description: - Extra options to the zonecfg(1M) create command. type: str install_options: default: '' description: - Extra options to the zoneadm(1M) install command. To automate Solaris 11 zone creation, use this to specify the profile XML file, e.g. install_options="-c sc_profile.xml" type: str