main.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. # Copyright 2021 Dell Inc. or its subsidiaries. All Rights Reserved.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. ---
  15. #Tasks for Deploying cobbler on the system
  16. - name: Check cobbler status on machine
  17. include_tasks: check_prerequisites.yml
  18. - name: Mount iso image
  19. import_tasks: mount_iso.yml
  20. when: not cobbler_image_status
  21. - name: Modify firewall settings for Cobbler
  22. import_tasks: firewall_settings.yml
  23. when: not cobbler_container_status
  24. - name: Decrpyt login_vars.yml
  25. command: >-
  26. ansible-vault decrypt {{ login_file }}
  27. --vault-password-file {{ login_vault_file }}
  28. changed_when: false
  29. - name: Include variable file login_vars.yml
  30. include_vars: "{{ login_file }}"
  31. # no_log: true
  32. - name: Include variable file base_vars.yml
  33. include_vars: "{{ base_file }}"
  34. # no_log: true
  35. - name: Include common variables
  36. include_vars: ../../control_plane_common/vars/main.yml
  37. when: not cobbler_container_status
  38. - name: Internet validation
  39. include_tasks: ../../control_plane_common/tasks/internet_validation.yml
  40. when: not cobbler_container_status
  41. - name: Provision password validation
  42. import_tasks: provision_password.yml
  43. when: not cobbler_image_status
  44. - name: Encypt login file
  45. command: >-
  46. ansible-vault encrypt {{ login_file }}
  47. --vault-password-file {{ login_vault_file }}
  48. changed_when: false
  49. - name: Dhcp Configuration
  50. import_tasks: dhcp_configure.yml
  51. when: (not cobbler_image_status) or ( backup_map_status == true)
  52. - name: Mapping file validation
  53. import_tasks: mapping_file.yml
  54. when: (not cobbler_image_status) and (host_mapping_file == true) or ( backup_map_status == true)
  55. - name: Cobbler image creation
  56. import_tasks: cobbler_image.yml
  57. when: not cobbler_container_status
  58. - name: Cobbler configuration
  59. import_tasks: configure_cobbler.yml
  60. - name: Cobbler container status message
  61. block:
  62. - debug:
  63. msg: "{{ message_skipped }}"
  64. verbosity: 2
  65. when: cobbler_container_status
  66. - debug:
  67. msg: "{{ message_installed }}"
  68. verbosity: 2
  69. when: not cobbler_container_status
  70. tags: install