user_data.j2 1.1 KB

123456789101112131415161718192021222324252627
  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.group }}
  11. {% if openshift_aws_node_group.group != 'master' %}
  12. - path: /etc/origin/node/bootstrap.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.group != 'master' %}
  23. - [ systemctl, restart, NetworkManager]
  24. - [ systemctl, enable, {% if openshift_deployment_type == 'openshift-enterprise' %}atomic-openshift{% else %}origin{% endif %}-node]
  25. - [ systemctl, start, {% if openshift_deployment_type == 'openshift-enterprise' %}atomic-openshift{% else %}origin{% endif %}-node]
  26. {% endif %}
  27. {% endif %}