Hi,

Over the past few months using Ansible, I've accumulated a handy bunch of
playbooks which create different varieties of servers. The top-level
directory looks like this :

modular-role-based-playbooks
-- [-rw-r--r--] create-bare-micro-instance-amazon.yml
-- [-rw-r--r--] create-captcha-server.yml
-- [-rw-r--r--] create-sandbox-server.yml
-- [-rw-r--r--] create-support.yml
-- [-rw-r--r--] create-test-machine-for-interview.yml
-- [-rw-r--r--] create-web.yml
-- [-rw-r--r--] create-webdriver.yml
-- [-rw-r--r--] create-worker.yml
-- [drwxr-xr-x] envs
-- [drwxr-xr-x] group_vars
-- [lrwxr-xr-x] inventories -> ../inventories
-- [drwxr-xr-x] make-playbook-with-roles
-- [drwxr-xr-x] roles
`-- [drwxr-xr-x] templates

How must I proceed so that with minimum redundancy I can create the same
types of servers inside VPC as well?

I understand that the ec2 module requires extra parameters passed when the
instance is to be created inside VPC, so is it possible to have a
conditional that disables/enables these parameters?

Any help would be appreciated.

--
Sankalp

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/256d9595-d1de-49fa-a7f4-97a56e9801e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Will Thames at Sep 24, 2014 at 1:04 am
    For your setup, I'd recommend either having a role to create an instance,
    or a single playbook that creates an instance and later kicks off
    ansible-pull. You really shouldn't have to be changing your use of the ec2
    module across multiple files.

    I would just choose values for the required variables so that they work in
    either environment.

    Let's say you have a group for VPC hosts (you might have multiple groups
    for multiple VPCs) - and one for non VPC hosts

    Then in the vpc1.yml, set things like vpc_subnet_id (looking at the docs
    that's the only one you'll likely need)
    In nonvpc.yml, have vpc_subnet_id: ""

    And then when you use the ec2 module, pass
    vpc_subnet_id: "{{vpc_subnet_id}}"

    Will
    On Wednesday, September 24, 2014 9:27:23 AM UTC+10, Sankalp Khare wrote:

    Hi,

    Over the past few months using Ansible, I've accumulated a handy bunch of
    playbooks which create different varieties of servers. The top-level
    directory looks like this :

    modular-role-based-playbooks
    -- [-rw-r--r--] create-bare-micro-instance-amazon.yml
    -- [-rw-r--r--] create-captcha-server.yml
    -- [-rw-r--r--] create-sandbox-server.yml
    -- [-rw-r--r--] create-support.yml
    -- [-rw-r--r--] create-test-machine-for-interview.yml
    -- [-rw-r--r--] create-web.yml
    -- [-rw-r--r--] create-webdriver.yml
    -- [-rw-r--r--] create-worker.yml
    -- [drwxr-xr-x] envs
    -- [drwxr-xr-x] group_vars
    -- [lrwxr-xr-x] inventories -> ../inventories
    -- [drwxr-xr-x] make-playbook-with-roles
    -- [drwxr-xr-x] roles
    `-- [drwxr-xr-x] templates

    How must I proceed so that with minimum redundancy I can create the same
    types of servers inside VPC as well?

    I understand that the ec2 module requires extra parameters passed when the
    instance is to be created inside VPC, so is it possible to have a
    conditional that disables/enables these parameters?

    Any help would be appreciated.

    --
    Sankalp

    --
    You received this message because you are subscribed to the Google Groups "Ansible Project" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
    To post to this group, send email to ansible-project@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/65b114b6-4d8f-4442-8a91-5b5435e9bc31%40googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupansible-project @
postedSep 23, '14 at 11:27p
activeSep 24, '14 at 1:04a
posts2
users2

2 users in discussion

Sankalp Khare: 1 post Will Thames: 1 post

People

Translate

site design / logo © 2022 Grokbase