Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- - name: Get {{ config_type }} configuration
- command: |
- /var/lib/ambari-server/resources/scripts/configs.py
- --user=admin
- --password=admin
- --port={{ AMBARI.ssl.port if AMBARI.ssl.enabled == True else 8080 }}
- --protocol={{ 'https' if AMBARI.ssl.enabled == True else 'http' }}
- --host={{ inventory_hostname }}.{{ domain }}
- --cluster={{ cluster_name }}
- --config-type={{ config_type }}
- --action=get
- --file /tmp/{{ config_type }}.json
- - name: Load {{ config_type }}
- slurp:
- path: "/tmp/{{ config_type }}.json"
- register: config_file
- - name: Register as JSON variables
- set_fact:
- config: "{{ config_file.content|b64decode|from_json }}"
- - name: Set {{ config_type }} properties
- set_fact:
- config: "{{ config|combine({'properties': { lookup('dict', item).key: lookup('dict', item).value } }, recursive=True) }}"
- with_items: "{{ conf }}"
- - name: Update {{ config_type }}
- copy:
- content: "{{ config }}"
- dest: /tmp/{{ config_type }}.json
- - name: Set {{ config_type }} configuration
- command: |
- /var/lib/ambari-server/resources/scripts/configs.py
- --user=admin
- --password=admin
- --port={{ AMBARI.ssl.port if AMBARI.ssl.enabled == True else 8080 }}
- --protocol={{ 'https' if AMBARI.ssl.enabled == True else 'http' }}
- --host={{ inventory_hostname }}.{{ domain }}
- --cluster={{ cluster_name }}
- --config-type={{ config_type }}
- --action=set
- --file /tmp/{{ config_type }}.json
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement