openstack-ansible/playbooks/roles/lxc_container_destroy
Kevin Carter 7c6e1260fe Updated ansible to use the latest stable release
This change was made to improve ansible stability and speed.
Additionally this change comes with the now upstream lxc-container
module which will allow us to drop our carried module. In dropping
the module the entry point was changed from `lxc-container:` to
`lxc_container:`. All of the entry points have been changed in
support of the new upstream module and the carried `lxc-container`
module has been removed.

Partially Implements Blueprint: master-kilofication
Partial-Bug: 1399373

Change-Id: I4709eb78f153afc213225ea973570efa2e873993
2015-04-08 08:29:53 +01:00
..
meta Convert existing roles into galaxy roles 2015-02-18 10:56:25 +00:00
tasks Updated ansible to use the latest stable release 2015-04-08 08:29:53 +01:00
CONTRIBUTING.rst Convert existing roles into galaxy roles 2015-02-18 10:56:25 +00:00
LICENSE Convert existing roles into galaxy roles 2015-02-18 10:56:25 +00:00
README.rst Convert existing roles into galaxy roles 2015-02-18 10:56:25 +00:00

README.rst

OpenStack LXC container destroy

tags

openstack, lxc, container, cloud, ansible

category

*nix

Role for destroying LXC containers. This role has been setup for use in OpenStack. This role will remove several directories on the LXC host which were used in bind mounted storage within the container.

Example Play:
- name: Destroy lxc containers
  hosts: all_containers
  gather_facts: false
  user: root
  roles:
    - { role: "lxc_container_destroy", tags: [ "lxc-container-destroy" ] }
Example Inventory:
{
    "all_containers": {
        "children": [
            "group_of_containers"
        ],
        "hosts": []
    },
    "lxc_hosts": {
        "children": [],
        "hosts": [
            "infra1"
        ]
    },
    "group_of_containers": {
        "children": [],
        "hosts": [
            "container1"
        ]
    },
    "_meta": {
        "hostvars": {
            "infra1": {
                "ansible_ssh_host": "192.168.0.1",
                "container_address": "192.168.0.1",
                "container_name": "infra1",
                "container_networks": {
                    "management_address": {
                        "bridge": "br-mgmt",
                        "interface": "eth1",
                        "netmask": "255.255.252.0",
                        "type": "veth"
                    }
                },
                "properties": {
                    "container_release": "trusty",
                    "is_metal": true
                }
            },
            "container1": {
                "ansible_ssh_host": "10.0.0.1",
                "container_address": "10.0.0.1",
                "container_name": "container1",
                "container_networks": {
                    "management_address": {
                        "address": "10.0.0.1",
                        "bridge": "br-mgmt",
                        "interface": "eth1",
                        "netmask": "255.255.252.0",
                        "type": "veth"
                    }
                },
                "physical_host": "infra1",
                "physical_host_group": "lxc_hosts",
                "properties": {
                    "container_release": "trusty",
                }
            }
        }
    }
}