arguments:
  java_distro:
    default: cloudera-jdk
    description: The distribution of Java to install. Defaults to openjdk.
    choices:
      - openjdk
      - oracle-java
      - cloudera-jdk
  plugin_version:
    default: 5.13.0
    description: The distribution of CDH to install. Defaults to 5.13.0.
    hidden: True
    required: False
    choices:
      - 5.13.0
  hdfs_lib_dir:
    default: /usr/lib/hadoop-mapreduce
    description: The path to HDFS_LIB_DIR. Default to /usr/lib/hadoop-mapreduce
    required: False
  unlimited_security_location:
    default: https://tarballs.openstack.org/sahara-extra/dist/common-artifacts/
    description: Place where UnlimitedSecurity polices are located
    required: False

validators:
  - os_case:
      - redhat:
          - package: wget
          - script:
              centos/wget_repo:
                env_vars: [plugin_version]
      - ubuntu:
          - script:
              ubuntu/wget_repo:
                env_vars: [plugin_version]
  - argument_case:
          argument_name: java_distro
          cases:
            openjdk:
              - any:
                - all:
                  - package: java-1.8.0-openjdk-devel
                - all:
                  - package: java-1.7.0-openjdk-devel
            cloudera-jdk:
              - all:
                - package: oracle-j2sdk1.7
  - package: ntp
  - package:
    - cloudera-manager-agent
    - cloudera-manager-daemons
    - cloudera-manager-server
    - cloudera-manager-server-db-2
  - package:
    - hadoop-hdfs-namenode
    - hadoop-hdfs-datanode
    - hadoop-hdfs-secondarynamenode
    - hadoop-mapreduce
    - hadoop-mapreduce-historyserver
    - hadoop-yarn-nodemanager
    - hadoop-yarn-resourcemanager
  - package:
    - hbase
    - hbase-solr
  - package:
    - hive-hcatalog
    - hive-metastore
    - hive-server2
    - hive-webhcat-server
    - hue
  - package:
    - oozie
    - spark-core
  - os_case:
    - redhat:
      - package: spark-history-server
  - package: zookeeper
  - package: unzip
  - package: flume-ng
  - package: hadoop-kms
  - package:
    - impala
    - impala-server
    - impala-state-store
    - impala-catalog
    - impala-shell
  - package:
    - sentry
    - solr-server
    - solr-doc
    - search
    - sqoop2
  - package:
    - kafka
    - kafka-server
  - script:
      common/install_cloudera:
        env_vars: [plugin_version]
  - script: common/install_extjs
  - os_case:
    - redhat:
      - script: centos/turn_off_services
    - ubuntu:
      - script: ubuntu/turn_off_services
  - script:
      common/add_jar:
        env_vars: [plugin_version, hdfs_lib_dir]
  - script:
      common/unlimited_security_artifacts:
        env_vars: [unlimited_security_location]
  - os_case:
    - redhat:
      - package:
        - krb5-server
        - krb5-libs
        - krb5-workstation
        - rng-tools
      - package: iptables-services
      - script: centos/selinux_permissive
      - script: centos/disable_firewall
      - package: nmap-ncat
    - ubuntu:
      - package:
        - krb5-admin-server
        - libpam-krb5
        - ldap-utils
        - krb5-user
        - rng-tools
