user_data.j2 1.0 KB

1234567891011121314151617181920212223242526
  1. {% if openshift_aws_node_user_data is defined and openshift_aws_node_user_data != '' %}
  2. {{ openshift_aws_node_user_data }}
  3. {% else %}
  4. #cloud-config
  5. write_files:
  6. - path: /root/openshift_bootstrap/openshift_settings.yaml
  7. owner: 'root:root'
  8. permissions: '0640'
  9. content: |
  10. openshift_group_type: {{ openshift_aws_node_group_type }}
  11. {% if openshift_aws_node_group_type != 'master' %}
  12. - path: /etc/origin/node/csr_kubeconfig
  13. owner: 'root:root'
  14. permissions: '0640'
  15. encoding: b64
  16. content: {{ openshift_aws_launch_config_bootstrap_token | b64encode }}
  17. {% endif %}
  18. runcmd:
  19. {% if openshift_aws_node_run_bootstrap_startup %}
  20. - [ ansible-playbook, /root/openshift_bootstrap/bootstrap.yml]
  21. {% endif %}
  22. {% if openshift_aws_node_group_type != 'master' %}
  23. - [ systemctl, enable, {% if openshift_deployment_type == 'openshift-enterprise' %}atomic-openshift{% else %}origin{% endif %}-node]
  24. - [ systemctl, start, {% if openshift_deployment_type == 'openshift-enterprise' %}atomic-openshift{% else %}origin{% endif %}-node]
  25. {% endif %}
  26. {% endif %}