user_data.j2 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #cloud-config
  2. disable_root: {{ openshift_openstack_disable_root }}
  3. system_info:
  4. default_user:
  5. name: {{ openshift_openstack_user }}
  6. sudo: ["ALL=(ALL) NOPASSWD: ALL"]
  7. write_files:
  8. - path: /etc/sudoers.d/00-openshift-no-requiretty
  9. permissions: 440
  10. content: |
  11. Defaults:openshift !requiretty
  12. - path: /root/openshift_bootstrap/openshift_settings.yaml
  13. owner: 'root:root'
  14. permissions: '0640'
  15. content: |
  16. openshift_node_config_name: %OPENSHIFT_NODE_CONFIG_NAME%
  17. {% if openshift_openstack_provision_user_commands %}
  18. - path: /root/ansible_install.sh
  19. permissions: '0544'
  20. content: |
  21. {% for cmd in openshift_openstack_provision_user_commands %}
  22. {% if cmd is string %}
  23. {{ cmd }}
  24. {% elif cmd is iterable %}
  25. {{ cmd|join(' ') }}
  26. {% endif %}
  27. {% endfor %}
  28. {% endif %}
  29. runcmd:
  30. {% if openshift_openstack_provision_user_commands %}
  31. - /root/ansible_install.sh
  32. {% endif %}
  33. {% if openshift_openstack_node_run_bootstrap_startup %}
  34. - [ ansible-playbook, /root/openshift_bootstrap/bootstrap.yml]
  35. {% endif %}