From ab0465195c1be8dea29eeed03cf71da767fe446e Mon Sep 17 00:00:00 2001 From: Dmitry Shulyak Date: Fri, 17 Apr 2015 12:46:52 +0300 Subject: [PATCH] Use resource as primary citizen in inventory --- examples/nodes_list.yaml | 4 ++-- examples/resources/docker.yml | 2 +- examples/resources/docker2.yml | 13 +++++++++++++ examples/resources/mariadb.yml | 2 ++ examples/resources/simple/docker/remove.yml | 2 +- examples/resources/simple/docker/run.yml | 2 +- 6 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 examples/resources/docker2.yml diff --git a/examples/nodes_list.yaml b/examples/nodes_list.yaml index b5258a2..d25ecc4 100644 --- a/examples/nodes_list.yaml +++ b/examples/nodes_list.yaml @@ -1,9 +1,9 @@ -- id: 6176aaa2-d97f-11e4-8dbe-080027c2ffdb +- id: node_1 ip: 10.0.0.2 ssh_user: vagrant ssh_private_key_path: /vagrant/tmp/keys/ssh_private -- id: cc48cf72-df88-11e4-9f5b-080027c2ffdb +- id: node_2 ip: 10.0.0.3 ssh_user: vagrant ssh_private_key_path: /vagrant/tmp/keys/ssh_private diff --git a/examples/resources/docker.yml b/examples/resources/docker.yml index d6ef94d..07b80d1 100644 --- a/examples/resources/docker.yml +++ b/examples/resources/docker.yml @@ -1,4 +1,4 @@ -id: docker +id: docker_1 type: resource handler: ansible version: v1 diff --git a/examples/resources/docker2.yml b/examples/resources/docker2.yml new file mode 100644 index 0000000..e5d9e5f --- /dev/null +++ b/examples/resources/docker2.yml @@ -0,0 +1,13 @@ +id: docker_2 +type: resource +handler: ansible +version: v1 +actions: + run: simple/docker/run.yml + remove: simple/docker/remove.yml +input: + base_image: ubuntu + node: + link: node_2 +tags: [service/docker] + diff --git a/examples/resources/mariadb.yml b/examples/resources/mariadb.yml index eb5ff64..5ccf8fe 100644 --- a/examples/resources/mariadb.yml +++ b/examples/resources/mariadb.yml @@ -2,11 +2,13 @@ id: mariadb type: resource handler: ansible version: v1 + actions: run: simple/mariadb/run.yml remove: simple/mariadb/remove.yml wait: simple/mariadb/wait.yml users: simple/mariadb/users.yml + input: name: mariadb-test image: kollaglue/fedora-rdo-mariadb-app diff --git a/examples/resources/simple/docker/remove.yml b/examples/resources/simple/docker/remove.yml index 0d02ace..f24c621 100644 --- a/examples/resources/simple/docker/remove.yml +++ b/examples/resources/simple/docker/remove.yml @@ -1,4 +1,4 @@ -- hosts: [docker] +- hosts: [service/docker] sudo: yes tasks: - shell: apt-get remove -y lxc-docker diff --git a/examples/resources/simple/docker/run.yml b/examples/resources/simple/docker/run.yml index 694e86a..c3a6be3 100644 --- a/examples/resources/simple/docker/run.yml +++ b/examples/resources/simple/docker/run.yml @@ -1,5 +1,5 @@ -- hosts: [docker] +- hosts: [service/docker] sudo: yes tasks: - shell: docker --version