init.sls 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #
  2. # Pressed
  3. #
  4. /srv/provision:
  5. file.directory
  6. # Debian presseds
  7. /srv/provision/preseed:
  8. file.directory:
  9. - require:
  10. - file: /srv/provision
  11. /srv/provision/preseed/apu-bullseye.txt:
  12. file.managed:
  13. - source: salt://install-server/preseed/apu-bullseye.txt
  14. - template: jinja
  15. - context:
  16. provision_fqdn: {{ salt['pillar.get']('globals:provision:webserver_fqdn') }}
  17. - require:
  18. - file: /srv/provision/preseed
  19. # Conveniece symlink for short http URL
  20. /srv/provision/apu.txt:
  21. file.symlink:
  22. - target: /srv/provision/preseed/apu-bullseye.txt
  23. - require:
  24. - file: /srv/provision/preseed/apu-bullseye.txt
  25. # Late command downloaded into and run from preseed
  26. /srv/provision/late-command.sh:
  27. file.managed:
  28. - source: salt://install-server/late-command.sh.tmpl
  29. - template: jinja
  30. - context:
  31. nacl_url: {{ salt['pillar.get']('globals:nacl:url') }}
  32. salt_master_fqdn: {{ salt['pillar.get']("globals:salt:master") }}
  33. - require:
  34. - file: /srv/provision
  35. # First boot script + service
  36. /srv/provision/ffho-first-boot.sh:
  37. file.managed:
  38. - source: salt://install-server/ffho-first-boot.sh
  39. - require:
  40. - file: /srv/provision
  41. /srv/provision/ffho-first-boot.service:
  42. file.managed:
  43. - source: salt://install-server/ffho-first-boot.service
  44. - require:
  45. - file: /srv/provision
  46. # Local copy of NACL CLI tools
  47. Create /srv/provision/nacl:
  48. file.directory:
  49. - name: /srv/provision/nacl
  50. - require:
  51. - file: /srv/provision
  52. {% for file_name in ['get_fqdn', 'register_ssh_keys'] %}
  53. /srv/provision/nacl/{{ file_name }}:
  54. file.managed:
  55. - source: salt://install-server/nacl/{{ file_name }}
  56. - require:
  57. - file: Create /srv/provision/nacl
  58. - require_in:
  59. - file: Clean /srv/provision/nacl
  60. {% endfor %}
  61. Clean /srv/provision/nacl:
  62. file.directory:
  63. - name: /srv/provision/nacl
  64. - clean: true