Skip to content

Commit 1833012

Browse files
authored
Merge pull request #683 from CodeNow/move-inventories-2
Move inventories 2
2 parents f1b8477 + c642cb9 commit 1833012

27 files changed

Lines changed: 520 additions & 443 deletions

File tree

.gitignore

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,16 @@ npm-debug.log
99
ca.srl
1010
.DS_Store
1111
ansible/roles/hipache/templates/runnable*
12-
ansible/certs/*
13-
ansible/k8/**/configMaps/*cert*
12+
enviroments/**/k8/**/configMaps/*cert*
13+
environments/*/secrets/**/*
14+
# Leaving for now while PR is merged
15+
environments/*/k8
16+
# Meant to not break anything. Might remove later
17+
environments/self-hosted-test
1418
*.retry
1519
*.tfstate*
1620
terraform/credentials.tfvars
1721
terraform/.build
1822
ansible/secrets/*
23+
ansible/single-host-part-*.yml
1924
.idea

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ https://github.com/CodeNow/devops-scripts
1919
3. Change to the devops scripts repo directory and run the following command:
2020
`ln -s /<local-path-to-devops-scripts>/ssh/config ~/.ssh/config`
2121

22-
4. Obtain the "Ansible Secrets" zip from one password
22+
4. Obtain the "Ansible Secrets" zip for the environment you want to deploy (or create the new environment following [./environments/README.md](./environments/README.md))
2323

24-
5. Unzip file obtained above into `devops-scripts/ansible/secrets`
24+
5. Unzip file obtained above into `devops-scripts/environments/${YOUR_ENV}/secrets`
2525

2626
6. Copy the `*.pem` files from `devops-scripts/ansible/secrets` to your `~/.ssh` directory
2727

@@ -71,14 +71,15 @@ of the docker image needed to run the service on our architecture.
7171

7272
##### Command
7373
```
74-
ansible-playbook -i ./[inventory_dir] [service-playbook] -e git_branch=[branch-or-tag] -t deploy
74+
ansible-playbook -i ./[inventory_dir] [service-playbook] -e @[main-var-file] -e git_branch=[branch-or-tag] -t deploy
7575
```
7676

7777
##### Arguments
7878
- `[inventory_dir]` - The environment inventory files (servers and variables). Should be one of the following:
79-
- `stage-hosts` - Runnable sandbox staging environment services
80-
- `gamma-hosts` - Gamma services (internal use only; production mirror)
81-
- `delta-hosts` - Delta services (real production)
79+
- `/enviroments/stage` - Runnable sandbox staging environment services
80+
- `/environments/gamma` - Gamma services (internal use only; production mirror)
81+
- `/environments/delta` - Delta services (real production)
82+
- `[main-var-file]` - The file with the main variables for the environment
8283
- `[service-playbook]` - The playbook for the service you wish to deploy, ex:
8384
- `api.yml` - Deploys both the api and the api-workers services
8485
- `shiva.yml` - Deploys the shiva micro-service
@@ -98,15 +99,15 @@ being tested in the production mirror.
9899

99100
##### Command
100101
```
101-
ansible-playbook -i ./[inventory_dir] [service-playbook] -e git_branch=[branch-or-tag] -e build_args=--no-cache
102+
ansible-playbook -i ./[inventory_dir] [service-playbook] -e @[main-var-file] -e git_branch=[branch-or-tag] -t deploy -e build_args=--no-cache
102103
```
103104

104105
##### Arguments
105106
- `[inventory_dir]` - The environment inventory files (servers and variables).
107+
- `[main-var-file]` - The file with the main variables for the environment
106108
- `[service-playbook]` - The playbook for the service you wish to deploy.
107109
- `[branch-or-tag]` - The branch or tag you wish to deploy.
108110

109-
110111
## Reverting
111112
If, for some reason, the new deploy is not operating as expected you can quickly revert by referencing the tag you collected in Step 1.
112113
Simply run the appropriate deploy command in the previous section with the last release tag and the new deploy will be reverted.

ansible/delta-hosts/variables

Lines changed: 0 additions & 215 deletions
This file was deleted.

0 commit comments

Comments
 (0)