Skip to content

create dock with ansible #264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 36 commits into from
Jan 27, 2016
Merged

create dock with ansible #264

merged 36 commits into from
Jan 27, 2016

Conversation

anandkumarpatel
Copy link

Person need to create EC2 instance with following details:

EC2 type: t2 micro
ami: ami-9abea4fb
security_group: sg-577a0d33
vpc: vpc-c53464a0
subnet: subnet-35d6486c

user data

!/bin/bash

sudo su
lsblk /dev/xvdb > /dev/null 2>&1
fsck /dev/xvdb > /dev/null 2>&1
mkdir /docker
mkfs -t ext4 -i 8192 /dev/xvdb
mount /dev/xvdb /docker
cat << EOF >> /etc/fstab
/dev/xvdb /docker ext4 defaults,nofail 0 2
EOF

disks
VolumeType: Root
device: /dev/sda1
snapshot: snap-306df873
size: 30 GB
VolumeType: gp2
DeleteOnTermination: yes
Encrypted: no

VolumeType: ebs
device: /dev/sdb
snapshot:
size: 200 GB
VolumeType: gp2
DeleteOnTermination: yes
Encrypted: no

Tag
key1: Name
Value1: Dock
key2: Org
Value2: 2335750
key3: role
Value3: dock

Keypair: gamma

create the AMI

Add roles to package for AWS, vault, waver and certificates.

@anandkumarpatel anandkumarpatel changed the title Fix stage configs create dock with ansible Jan 12, 2016
- { file_name: 'token-03', value: "{{ vault_token_03 }}" }

- name: copy rollbar token
tags: rollbar
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not make this lineinfile line above? that way we can maintain just variables, not the files

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

variable are les secured than file. We can put files in vault. So we don't to put the variables file in vault. The whole purpose of vault is security, if we give the things that secure in form of variable. Is it secure?
If you still think that the way you me to code, I have no problem

name={{ dock }}
groups=dock

- include: dock-init.yml git_branch=v5.1.3
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update these versions when you get a chance, (look at each repo and pick latest release)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update these please

@@ -0,0 +1 @@
---
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this file

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PING

@kaushikanurag
Copy link
Contributor

To test the ec2 instance run the following command in order (VERY IMPORTANT TO RUN IN ORDER)

Test

Instance need to have org tag for dock-init to work
Make sure docker is not running

#!/bin/bash
sudo su
export DONT_DELETE_KEYS="DONT-DELETE"
export CONSUL_HOSTNAME=10.4.6.251
DOCK_INIT_SCRIPT=/opt/runnable/dock-init/init.sh
bash $DOCK_INIT_SCRIPT >> /var/log/user-script-dock-init.log 2>&1

- { role: consul_value, tags: [deploy, consul_value] }
- { role: datadog, tags: [deploy, datadog] }
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does not need deploy tag, also move this to line 12 above git_repo role

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anandkumarpatel you mean move line 15 above line 12?

@und1sk0
Copy link
Contributor

und1sk0 commented Jan 27, 2016

💯 tested this out with a charon deploy. works.

anandkumarpatel pushed a commit that referenced this pull request Jan 27, 2016
@anandkumarpatel anandkumarpatel merged commit a1c0210 into master Jan 27, 2016
@anandkumarpatel anandkumarpatel deleted the fix-stage-configs branch January 27, 2016 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants