generated from the-liberated-edge/wikijs
yamlfix code base
This commit is contained in:
parent
17de1c43b6
commit
19f8a9b1df
@ -2,8 +2,7 @@
|
|||||||
- name: Converge
|
- name: Converge
|
||||||
hosts: all
|
hosts: all
|
||||||
gather_facts: false
|
gather_facts: false
|
||||||
|
|
||||||
- name: imports and executes the playbook under test
|
- name: imports and executes the playbook under test
|
||||||
ansible.builtin.import_playbook: ../../../launch_linux_container.yml
|
ansible.builtin.import_playbook: ../../../launch_linux_container.yml
|
||||||
vars:
|
vars:
|
||||||
lte_container_name: "{{ molecule_yml.platforms[0].name }}"
|
lte_container_name: '{{ molecule_yml.platforms[0].name }}'
|
||||||
|
|||||||
@ -5,17 +5,14 @@
|
|||||||
gather_facts: false
|
gather_facts: false
|
||||||
tasks:
|
tasks:
|
||||||
- name: find current container state
|
- name: find current container state
|
||||||
ansible.builtin.command: "lxc ls {{ item.name }}"
|
ansible.builtin.command: lxc ls {{ item.name }}
|
||||||
register: container_state
|
register: container_state
|
||||||
changed_when: false
|
changed_when: false
|
||||||
with_items: "{{ molecule_yml.platforms }}"
|
with_items: '{{ molecule_yml.platforms }}'
|
||||||
|
|
||||||
- name: stop running containers
|
- name: stop running containers
|
||||||
ansible.builtin.shell:
|
ansible.builtin.shell:
|
||||||
cmd: |
|
cmd: |
|
||||||
lxc stop {{ item.name }} && \
|
lxc stop {{ item.name }} && \
|
||||||
lxc rm {{ item.name }}
|
lxc rm {{ item.name }}
|
||||||
when:
|
when: (container_state.results[0].rc == 0) and ("RUNNING" in container_state.results[0].stdout)
|
||||||
(container_state.results[0].rc == 0) and
|
with_items: '{{ molecule_yml.platforms }}'
|
||||||
("RUNNING" in container_state.results[0].stdout)
|
|
||||||
with_items: "{{ molecule_yml.platforms }}"
|
|
||||||
|
|||||||
@ -4,12 +4,9 @@
|
|||||||
gather_facts: false
|
gather_facts: false
|
||||||
tasks:
|
tasks:
|
||||||
- name: find current container state
|
- name: find current container state
|
||||||
ansible.builtin.command: "lxc ls {{ item.name }}"
|
ansible.builtin.command: lxc ls {{ item.name }}
|
||||||
register: container_state
|
register: container_state
|
||||||
with_items: "{{ molecule_yml.platforms }}"
|
with_items: '{{ molecule_yml.platforms }}'
|
||||||
|
|
||||||
- name: verify launched container is running
|
- name: verify launched container is running
|
||||||
assert:
|
assert:
|
||||||
that:
|
that: (container_state.results[0].rc == 0) and ("RUNNING" in container_state.results[0].stdout)
|
||||||
(container_state.results[0].rc == 0) and
|
|
||||||
("RUNNING" in container_state.results[0].stdout)
|
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
---
|
||||||
### REQUIRED
|
### REQUIRED
|
||||||
# The namespace of the collection. This can be a company/brand/organization or product namespace under which all
|
# The namespace of the collection. This can be a company/brand/organization or product namespace under which all
|
||||||
# content lives. May only contain alphanumeric lowercase characters and underscores. Namespaces cannot start with
|
# content lives. May only contain alphanumeric lowercase characters and underscores. Namespaces cannot start with
|
||||||
@ -12,22 +13,17 @@ version: 1.0.0
|
|||||||
|
|
||||||
# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
|
# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
|
||||||
readme: README.md
|
readme: README.md
|
||||||
|
|
||||||
# A list of the collection's content authors. Can be just the name or in the format 'Full Name <email> (url)
|
# A list of the collection's content authors. Can be just the name or in the format 'Full Name <email> (url)
|
||||||
# @nicks:irc/im.site#channel'
|
# @nicks:irc/im.site#channel'
|
||||||
authors:
|
authors:
|
||||||
- your name <example@domain.com>
|
- your name <example@domain.com>
|
||||||
|
|
||||||
|
|
||||||
### OPTIONAL but strongly recommended
|
### OPTIONAL but strongly recommended
|
||||||
# A short summary description of the collection
|
# A short summary description of the collection
|
||||||
description: your collection description
|
description: your collection description
|
||||||
|
|
||||||
# Either a single license or a list of licenses for content inside of a collection. Ansible Galaxy currently only
|
# Either a single license or a list of licenses for content inside of a collection. Ansible Galaxy currently only
|
||||||
# accepts L(SPDX,https://spdx.org/licenses/) licenses. This key is mutually exclusive with 'license_file'
|
# accepts L(SPDX,https://spdx.org/licenses/) licenses. This key is mutually exclusive with 'license_file'
|
||||||
license:
|
license:
|
||||||
- GPL-2.0-or-later
|
- GPL-2.0-or-later
|
||||||
|
|
||||||
# The path to the license file for the collection. This path is relative to the root of the collection. This key is
|
# The path to the license file for the collection. This path is relative to the root of the collection. This key is
|
||||||
# mutually exclusive with 'license'
|
# mutually exclusive with 'license'
|
||||||
license_file: ''
|
license_file: ''
|
||||||
@ -66,4 +62,3 @@ build_ignore: []
|
|||||||
# 'omit_default_directives' is a boolean that controls whether the default directives are used. Mutually exclusive
|
# 'omit_default_directives' is a boolean that controls whether the default directives are used. Mutually exclusive
|
||||||
# with 'build_ignore'
|
# with 'build_ignore'
|
||||||
# manifest: null
|
# manifest: null
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
- name: launch linux container
|
- name: launch linux container
|
||||||
hosts: localhost
|
hosts: localhost
|
||||||
gather_facts: false
|
gather_facts: false
|
||||||
|
|||||||
@ -1,52 +1,2 @@
|
|||||||
---
|
---
|
||||||
# Collections must specify a minimum required ansible version to upload
|
...
|
||||||
# to galaxy
|
|
||||||
# requires_ansible: '>=2.9.10'
|
|
||||||
|
|
||||||
# Content that Ansible needs to load from another location or that has
|
|
||||||
# been deprecated/removed
|
|
||||||
# plugin_routing:
|
|
||||||
# action:
|
|
||||||
# redirected_plugin_name:
|
|
||||||
# redirect: ns.col.new_location
|
|
||||||
# deprecated_plugin_name:
|
|
||||||
# deprecation:
|
|
||||||
# removal_version: "4.0.0"
|
|
||||||
# warning_text: |
|
|
||||||
# See the porting guide on how to update your playbook to
|
|
||||||
# use ns.col.another_plugin instead.
|
|
||||||
# removed_plugin_name:
|
|
||||||
# tombstone:
|
|
||||||
# removal_version: "2.0.0"
|
|
||||||
# warning_text: |
|
|
||||||
# See the porting guide on how to update your playbook to
|
|
||||||
# use ns.col.another_plugin instead.
|
|
||||||
# become:
|
|
||||||
# cache:
|
|
||||||
# callback:
|
|
||||||
# cliconf:
|
|
||||||
# connection:
|
|
||||||
# doc_fragments:
|
|
||||||
# filter:
|
|
||||||
# httpapi:
|
|
||||||
# inventory:
|
|
||||||
# lookup:
|
|
||||||
# module_utils:
|
|
||||||
# modules:
|
|
||||||
# netconf:
|
|
||||||
# shell:
|
|
||||||
# strategy:
|
|
||||||
# terminal:
|
|
||||||
# test:
|
|
||||||
# vars:
|
|
||||||
|
|
||||||
# Python import statements that Ansible needs to load from another location
|
|
||||||
# import_redirection:
|
|
||||||
# ansible_collections.ns.col.plugins.module_utils.old_location:
|
|
||||||
# redirect: ansible_collections.ns.col.plugins.module_utils.new_location
|
|
||||||
|
|
||||||
# Groups of actions/modules that take a common set of options
|
|
||||||
# action_groups:
|
|
||||||
# group_name:
|
|
||||||
# - module1
|
|
||||||
# - module2
|
|
||||||
|
|||||||
@ -1,2 +1,2 @@
|
|||||||
---
|
---
|
||||||
# defaults file for linux_container
|
...
|
||||||
|
|||||||
@ -1,2 +1,2 @@
|
|||||||
---
|
---
|
||||||
# handlers file for linux_container
|
...
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
---
|
||||||
galaxy_info:
|
galaxy_info:
|
||||||
author: your name
|
author: your name
|
||||||
description: your role description
|
description: your role description
|
||||||
@ -15,7 +16,6 @@ galaxy_info:
|
|||||||
# - Apache-2.0
|
# - Apache-2.0
|
||||||
# - CC-BY-4.0
|
# - CC-BY-4.0
|
||||||
license: license (GPL-2.0-or-later, MIT, etc)
|
license: license (GPL-2.0-or-later, MIT, etc)
|
||||||
|
|
||||||
min_ansible_version: 2.1
|
min_ansible_version: 2.1
|
||||||
|
|
||||||
# If this a Container Enabled role, provide the minimum Ansible Container version.
|
# If this a Container Enabled role, provide the minimum Ansible Container version.
|
||||||
@ -38,7 +38,6 @@ galaxy_info:
|
|||||||
# - 1.0
|
# - 1.0
|
||||||
# - 7
|
# - 7
|
||||||
# - 99.99
|
# - 99.99
|
||||||
|
|
||||||
galaxy_tags: []
|
galaxy_tags: []
|
||||||
# List tags for your role here, one per line. A tag is a keyword that describes
|
# List tags for your role here, one per line. A tag is a keyword that describes
|
||||||
# and categorizes the role. Users find roles by searching for tags. Be sure to
|
# and categorizes the role. Users find roles by searching for tags. Be sure to
|
||||||
@ -46,7 +45,6 @@ galaxy_info:
|
|||||||
#
|
#
|
||||||
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
|
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
|
||||||
# Maximum 20 tags per role.
|
# Maximum 20 tags per role.
|
||||||
|
|
||||||
dependencies: []
|
dependencies: []
|
||||||
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
|
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
|
||||||
# if you add dependencies to this list.
|
# if you add dependencies to this list.
|
||||||
|
|||||||
@ -1,15 +1,12 @@
|
|||||||
---
|
---
|
||||||
- name: find current container state
|
- name: find current container state
|
||||||
ansible.builtin.command: "lxc ls {{ lte_container_name }}"
|
ansible.builtin.command: lxc ls {{ lte_container_name }}
|
||||||
register: container_state
|
register: container_state
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
- name: launch debian bookworm linux container
|
- name: launch debian bookworm linux container
|
||||||
ansible.builtin.shell:
|
ansible.builtin.shell:
|
||||||
cmd: |
|
cmd: |
|
||||||
lxc launch \
|
lxc launch \
|
||||||
images:debian/bookworm/cloud \
|
images:debian/bookworm/cloud \
|
||||||
{{ lte_container_name }}
|
{{ lte_container_name }}
|
||||||
when:
|
when: (container_state.rc == 1) or ("RUNNING" not in container_state.stdout)
|
||||||
(container_state.rc == 1) or
|
|
||||||
("RUNNING" not in container_state.stdout)
|
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
---
|
---
|
||||||
- hosts: localhost
|
- hosts: localhost
|
||||||
remote_user: root
|
remote_user: root
|
||||||
roles:
|
roles: [linux_container]
|
||||||
- linux_container
|
|
||||||
|
|||||||
@ -1,2 +1,2 @@
|
|||||||
---
|
---
|
||||||
# vars file for linux_container
|
...
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user