summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/cluster15
1 files changed, 14 insertions, 1 deletions
diff --git a/bin/cluster b/bin/cluster
index 746c0349a..c80fe0cab 100755
--- a/bin/cluster
+++ b/bin/cluster
@@ -23,6 +23,16 @@ class Cluster(object):
'-o ControlMaster=auto '
'-o ControlPersist=600s '
)
+ # Because of `UserKnownHostsFile=/dev/null`
+ # our `.ssh/known_hosts` file most probably misses the ssh host public keys
+ # of our servers.
+ # In that case, ansible serializes the execution of ansible modules
+ # because we might be interactively prompted to accept the ssh host public keys.
+ # Because of `StrictHostKeyChecking=no` we know that we won't be prompted
+ # So, we don't want our modules execution to be serialized.
+ os.environ['ANSIBLE_HOST_KEY_CHECKING'] = 'False'
+ # TODO: A more secure way to proceed would consist in dynamically
+ # retrieving the ssh host public keys from the IaaS interface
def get_deployment_type(self, args):
"""
@@ -51,6 +61,7 @@ class Cluster(object):
env['num_masters'] = args.masters
env['num_nodes'] = args.nodes
+ env['num_infra'] = args.infra
env['num_etcd'] = args.etcd
return self.action(args, inventory, env, playbook)
@@ -149,7 +160,7 @@ class Cluster(object):
boto_conf_files = ['~/.aws/credentials', '~/.boto']
conf_exists = lambda conf: os.path.isfile(os.path.expanduser(conf))
- boto_configs = [ conf for conf in boto_conf_files if conf_exists(conf)]
+ boto_configs = [conf for conf in boto_conf_files if conf_exists(conf)]
if len(key_missing) > 0 and len(boto_configs) == 0:
raise ValueError("PROVIDER aws requires {} environment variable(s). See README_AWS.md".format(missing))
@@ -262,6 +273,8 @@ if __name__ == '__main__':
help='number of masters to create in cluster')
create_parser.add_argument('-n', '--nodes', default=2, type=int,
help='number of nodes to create in cluster')
+ create_parser.add_argument('-i', '--infra', default=1, type=int,
+ help='number of infra nodes to create in cluster')
create_parser.add_argument('-e', '--etcd', default=0, type=int,
help='number of external etcd hosts to create in cluster')
create_parser.set_defaults(func=cluster.create)