{"id":15089145,"url":"https://github.com/nomakcooper/zoneadm_facts","last_synced_at":"2026-01-04T12:45:12.503Z","repository":{"id":250077661,"uuid":"833379008","full_name":"NomakCooper/zoneadm_facts","owner":"NomakCooper","description":"Ansible Custom Module zoneadm_facts. Gathers facts about configured local zone on a SunOS/Oracle Solaris global zone by zoneadm","archived":false,"fork":false,"pushed_at":"2024-08-04T14:48:27.000Z","size":154,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-26T10:08:27.759Z","etag":null,"topics":["ansible","ansible-module","facts","python","solaris","solaris-10","solaris-11","yaml","zoneadm"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NomakCooper.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-24T23:45:48.000Z","updated_at":"2024-08-04T14:48:30.000Z","dependencies_parsed_at":"2024-09-29T23:00:53.114Z","dependency_job_id":"d7c4c3aa-8ca8-4865-8032-0d51441bce35","html_url":"https://github.com/NomakCooper/zoneadm_facts","commit_stats":{"total_commits":32,"total_committers":1,"mean_commits":32.0,"dds":0.0,"last_synced_commit":"efc9e70c415bd85402c333d9a9ccdb5ce930c752"},"previous_names":["nomakcooper/zoneadm_facts"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NomakCooper%2Fzoneadm_facts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NomakCooper%2Fzoneadm_facts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NomakCooper%2Fzoneadm_facts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NomakCooper%2Fzoneadm_facts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NomakCooper","download_url":"https://codeload.github.com/NomakCooper/zoneadm_facts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235688644,"owners_count":19029915,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","ansible-module","facts","python","solaris","solaris-10","solaris-11","yaml","zoneadm"],"created_at":"2024-09-25T08:41:16.893Z","updated_at":"2026-01-04T12:45:12.470Z","avatar_url":"https://github.com/NomakCooper.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cmeta name=\"author\" content=\"Marco Noce\"\u003e\n\u003cmeta name=\"description\" content=\"Gathers facts about configured local zone on a SunOS/Oracle Solaris global zone by zoneadm\"\u003e\n\u003cmeta name=\"copyright\" content=\"Marco Noce 2024\"\u003e\n\u003cmeta name=\"keywords\" content=\"ansible, module, fact, solaris, zoneadm, zone\"\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n![Ansible Custom Module][ansible-shield]\n![Oracle Solaris][solaris-shield]\n![python][python-shield]\n![license][license-shield]\n\n\u003c/div\u003e\n\n\n### zoneadm_facts ansible custom module\n#### Gathers facts about configured local zone on a SunOS/Oracle Solaris global zone by zoneadm\n\n#### Description :\n\n\u003cb\u003ezoneadm_facts\u003c/b\u003e is a custom module for ansible that creates an ansible_facts containing the list and details of configured local zones on a SunOS/Oracle Solaris global zone\n\n#### Repo files:\n\n```\n├── /library                \n│   └── zoneadm_facts.py  ##\u003c-- python custom module\n└── zoneadm_list.yml      ##\u003c-- ansible playbook example\n```\n\n#### Requirements :\n\n*  This module supports SunOS/Oracle Solaris only\n*  The Local Zone info are gathered from the [zoneadm] command\n\n#### Parameters :\n\n*  no parameters are needed\n\n#### Attributes :\n\n|Attribute |Support|Description                                                                         |\n|----------|-------|------------------------------------------------------------------------------------|\n|check_mode|full   |Can run in check_mode and return changed status prediction without modifying target.|\n|facts     |full   |Action returns an ansible_facts dictionary that will update existing host facts.    |\n\n#### Examples :\n\n#### Tasks\n```yaml\n---\n  # Gather local zone info\n  - name: Gather facts configured local zone\n    zoneadm_facts:\n\n  # print all lz name at running STATE\n  - name: Print all LZ at running STATE\n    debug:\n      msg: \"{{ ansible_facts.zone_list  | selectattr('STATUS','equalto', 'running' ) | map(attribute='NAME') }}\"\n\n  # print lz STATUS by ID\n  - name: Print STATUS of LZ ID 3\n    debug:\n      msg: \"LZ ID 3 STATUS : {{ ansible_facts.zone_list  | selectattr('ID','equalto', '3' ) | map(attribute='STATUS') | first }}\"\n\n```\n#### zone_list facts:\n```json\n\"ansible_facts\": {\n  \"zone_list\": [\n    {\n      \"STATUS\": \"running\",\n      \"NAME\": \"sol10lab\",\n      \"IP\": \"shared\",\n      \"BRAND\": \"solaris10\",\n      \"PATH\": \"/zones/sol10lab\",\n      \"ID\": \"3\"\n    }\n  ]\n},\n```\n#### debug output from example :\n```\nTASK [Print STATUS of LZ ID 3] *************************************************\nok: [global_zone_host] =\u003e {\n    \"msg\": \"LZ ID 3 STATUS : running\"\n}\n```\n```\nTASK [Print all LZ at running STATE] *******************************************\nok: [global_zone_host] =\u003e {\n    \"msg\": [\n        \"sol9lab\",\n        \"sol10lab\"\n    ]\n}\n```\n#### Returned Facts :\n\n*  Facts returned by this module are added/updated in the hostvars host facts and can be referenced by name just like any other host fact. They do not need to be registered in order to use them.\n\n|Key       |Type                  |Description                                                                       |Returned|Sample            |\n|----------|----------------------|----------------------------------------------------------------------------------|------- |------------------|\n|zone_list |list / elements=string|Configured local Zone list                                                        |        |                  |\n|ID        |string                |The local zone ID.                                                                |always  |\"10\"              |\n|NAME      |string                |The local zone name, could match the hostname of the local zone                   |always  |\"sol11lab\"        |\n|STATUS    |string                |The local zone status. running, installed, configured.                            |always  |\"running\"         |\n|PATH      |string                |The local zone path.                                                              |always  |\"/zones/sol11lab\" |\n|BRAND     |string                |The local zone brand. native, solaris10 and more.                                 |always  |\"native\"          |\n|IP        |string                |The local zone IP or shared.                                                      |always  |\"shared\"          |\n\n## SANITY TEST\n\n* Ansible sanity test is available in [SANITY.md] file\n\n## Integration\n\n1. Assuming you are in the root folder of your ansible project.\n\nSpecify a module path in your ansible configuration file.\n\n```shell\n$ vim ansible.cfg\n```\n```ini\n[defaults]\n...\nlibrary = ./library\n...\n```\n\nCreate the directory and copy the python modules into that directory\n\n```shell\n$ mkdir library\n$ cp path/to/module library\n```\n\n2. If you use Ansible AWX and have no way to edit the control node, you can add the /library directory to the same directory as the playbook .yml file\n\n```\n├── root repository\n│   ├── playbooks\n│   │    ├── /library                \n│   │    │   └── zoneadm_facts.py  ##\u003c-- python custom module\n│   │    └── your_playbook.yml      ##\u003c-- you playbook\n```   \n\n[ansible-shield]: https://img.shields.io/badge/Ansible-custom%20module-blue?style=for-the-badge\u0026logo=ansible\u0026logoColor=lightgrey\n[solaris-shield]: https://img.shields.io/badge/oracle-solaris-red?style=for-the-badge\u0026logo=oracle\u0026logoColor=red\n[python-shield]: https://img.shields.io/badge/python-blue?style=for-the-badge\u0026logo=python\u0026logoColor=yellow\n[license-shield]: https://img.shields.io/github/license/nomakcooper/zoneadm_facts?style=for-the-badge\u0026label=LICENSE\n\n[zoneadm]: https://docs.oracle.com/en/operating-systems/solaris/oracle-solaris/11.4/use-zones/using-zoneadm-command.html\n[SANITY.md]: SANITY.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnomakcooper%2Fzoneadm_facts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnomakcooper%2Fzoneadm_facts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnomakcooper%2Fzoneadm_facts/lists"}