{%- from 'cloudera/manager/settings.sls' import cloudera_manager with context %}

{% if cloudera_manager.communication.autotls_enabled == True %}
check_token:
  file.exists:
    - name: /etc/cloudera-scm-agent/cmagent.token
    - retry:
        attempts: 20
{% endif %}

start_agent:
  service.running:
    - enable: True
    - name: cloudera-scm-agent
{% if cloudera_manager.communication.autotls_enabled == True %}
    - require:
        - file: check_token
{% endif %}

{%- from 'cloudera/manager/settings.sls' import cloudera_manager with context %}

{% if cloudera_manager.communication.autotls_enabled == True %}
check_token:
  file.exists:
    - name: /etc/cloudera-scm-agent/cmagent.token
    - retry:
        attempts: 10
{% endif %}

start_agent:
  service.running:
    - enable: True
    - name: cloudera-scm-agent
{% if cloudera_manager.communication.autotls_enabled == True %}
    - require:
        - file: check_token
{% endif %}

Revert "CB-837 increase agent token check attempt to 20"
Revert "CB-837 increase agent token check attempt to 20"

This reverts commit 61c0e37d6b4729e32bf9ae4970bdad8d39efe0f7.

hortonworks/cloudbreak,hortonworks/cloudbreak,hortonworks/cloudbreak,hortonworks/cloudbreak,hortonworks/cloudbreak,hortonworks/cloudbreak