ansible-hortonworks
ansible-hortonworks copied to clipboard
Include inventory_to_use vars to add cluster's hosts in ambari_groups
This change permit to create a file in vars that define the cluster by overriding some of the properties defined in 'all' file without modifying it.
For example, I create playbooks/group_vars/poc_cluster: `--- cluster_name: 'poc_cluster'
ambari_admin_password: '123abc;' default_password: '123abc'
blueprint_dynamic:
-
host_group: "hdp-master" clients: ['ZOOKEEPER_CLIENT', 'HDFS_CLIENT', 'YARN_CLIENT', 'MAPREDUCE2_CLIENT', 'TEZ_CLIENT', 'PIG', 'SQOOP', 'HIVE_CLIENT', 'OOZIE_CLIENT', 'INFRA_SOLR_CLIENT', 'SPARK2_CLIENT', 'HBASE_CLIENT'] services: ['NAMENODE', 'SECONDARY_NAMENODE', 'ZOOKEEPER_SERVER', 'KAFKA_BROKER', 'RESOURCEMANAGER', 'APP_TIMELINE_SERVER', 'YARN_REGISTRY_DNS', 'TIMELINE_READER', 'HISTORYSERVER', 'HIVE_SERVER', 'HIVE_METASTORE', 'OOZIE_SERVER', 'HBASE_MASTER', 'SPARK2_JOBHISTORYSERVER', 'ZEPPELIN_MASTER', 'AMBARI_SERVER', 'INFRA_SOLR', 'NIFI_REGISTRY_MASTER']
-
host_group: "hdp-slave" clients: ['ZOOKEEPER_CLIENT', 'HDFS_CLIENT', 'YARN_CLIENT', 'MAPREDUCE2_CLIENT', 'TEZ_CLIENT', 'PIG', 'SQOOP', 'HIVE_CLIENT', 'OOZIE_CLIENT', 'INFRA_SOLR_CLIENT', 'SPARK2_CLIENT', 'HBASE_CLIENT'] services: ['DATANODE', 'NODEMANAGER', 'HBASE_REGIONSERVER', 'NIFI_MASTER'] `
Is the goal to have a single copy of ansible-hortonworks which you can then point to different inventories and group_vars/_ files at each run?
If so, that is a good feature, however it will need a bit more work:
- Name 'inventory_to_use' isn't appropriate as it sounds like we are selecting the inventory.
- Would need to update all the scripts to use it.
- Would need a way to indicate you want to use it instead of 'all'.
- Possibly defaulting to using the inventory name (i.e. group_vars/${inventory_to_use} and falling back to 'all' if it's not there).
- Or adding a switch or variable to make it use the named vars file.