Skip to content

Commit

Permalink
Move environment specific variables into examples
Browse files Browse the repository at this point in the history
Allow easy configuration to local environments
  • Loading branch information
willthames committed Sep 28, 2016
1 parent 732e962 commit e8e47c8
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Local environment specific variables
vars/local_config.yml
vars/secrets.yml
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,15 @@ If I have time I will modify the plays to run on AWS as well.
Create a Kubernetes cluster
---------------------------

Copy `vars/local_config.yml.example` to `vars/local_config.yml` and
update to your needs. These will be ignored by git so you can update
as you need. Similarly, copy `vars/secrets.yml.example` to `vars/secrets.yml`
and then use the `ansible-vault` tool to encrypt it, if you need to protect
it (you'll need to pass `--ask-vault-pass` when running the playbook if you
do this).

$ ansible-playbook k8s.yml

Some variables can be edited in the `k8s.yml` file.
This will start a Kubernetes master node and a number of compute nodes.

Check the tasks and templates in `roles/k8s`.
Expand Down
18 changes: 5 additions & 13 deletions k8s.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
---
- hosts: localhost
connection: local
vars:
ssh_key: k8s
k8s_version: 1.4.0
k8s_num_nodes: 2
k8s_security_group_name: k8s
k8s_node_prefix: kube
k8s_username: foobar
k8s_password: FdKPSuwQ
# This template name is specific to http://exoscale.ch, replace it
k8s_template: Linux CentOS 7.1 64-bit 50G Disk (2015-03-31-2230b6)
k8s_instance_type: Tiny
vars_files:
- vars/local_config.yml
- vars/secrets.yml

roles:
- common
- k8s
- common
- k8s
10 changes: 10 additions & 0 deletions vars/local_config.yml.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Update/replace this file with something appropriate to your environment
ssh_key: k8s
k8s_version: 1.4.0
k8s_num_nodes: 2
k8s_security_group_name: k8s
k8s_node_prefix: kube
k8s_username: foobar
# This template name is specific to http://exoscale.ch, replace it
k8s_template: Linux CentOS 7.1 64-bit 50G Disk (2015-03-31-2230b6)
k8s_instance_type: Tiny
2 changes: 2 additions & 0 deletions vars/secrets.yml.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# ansible-vault encrypt this file
k8s_password: FdKPSuwQ

0 comments on commit e8e47c8

Please sign in to comment.