Advertisement
Guest User

Untitled

a guest
May 4th, 2016
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. {% from "foreman/map.jinja" import foreman with context %}
  2. {% from "foreman/map.jinja" import foreman_packages with context %}
  3.  
  4. Foreman Packages:
  5. pkg.installed:
  6. - pkgs: {{ foreman.foreman_packages }}
  7.  
  8. Foreman Settings:
  9. file.managed:
  10. - name: /etc/foreman/settings.yaml
  11. - source: salt://foreman/templates/foreman/settings.yaml.jinja
  12. - template: jinja
  13. - mode: 644
  14.  
  15. Foreman Database:
  16. file.managed:
  17. - name: /etc/foreman/database.yml
  18. - source: salt://foreman/templates/foreman/database.yaml.jinja
  19. - template: jinja
  20. - mode: 644
  21.  
  22. Foreman Defaults:
  23. file.managed:
  24. - name: /etc/default/foreman
  25. - source: salt://foreman/templates/foreman/defaults.jinja
  26. - template: jinja
  27. - mode: 644
  28.  
  29. #############################################################################
  30. ### Everything below is bootstrap bits, other than service.running ##########
  31. #############################################################################
  32.  
  33.  
  34. Migrate Database:
  35. cmd.wait:
  36. - name: foreman-rake db:migrate
  37. - watch:
  38. - file: /etc/foreman/database.yml
  39.  
  40. # foreman-rake permission:reset username=admin password=changeme
  41. Set admin password:
  42. cmd.wait_script:
  43. - name: salt://certainty/templates/foreman/cmd_setpassword.jinja
  44. - template: jinja
  45. - watch:
  46. - file: /etc/foreman/database.yml
  47. - username: {{ foreman.server.user }}
  48. - password: {{ foreman.server.password }}
  49.  
  50. Set hammercli password:
  51. cmd.wait_script:
  52. - name: salt://certainty/templates/foreman/cmd_setpassword.jinja
  53. - template: jinja
  54. - watch:
  55. - file: /etc/hammer/cli_config.yml
  56. - username: {{ foreman.hammer.user }}
  57. - password: {{ foreman.hammer['password'] }}
  58. - output_loglevel: quiet
  59.  
  60. Foreman Running:
  61. service.running:
  62. - name: foreman
  63. - watch:
  64. - file: /etc/default/foreman
  65. - file: /etc/foreman/database.yml
  66. - file: /etc/foreman/settings.yaml
  67. # hammer location create --name vagrantlab
  68. # hammer organization create --name development
  69.  
  70. # The above will get foreman installed, using sqlite, and listing on port 3000
  71. # TODO: postgresql support, front end ssl proxy (nginx)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement