Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {% from "foreman/map.jinja" import foreman with context %}
- {% from "foreman/map.jinja" import foreman_packages with context %}
- Foreman Packages:
- pkg.installed:
- - pkgs: {{ foreman.foreman_packages }}
- Foreman Settings:
- file.managed:
- - name: /etc/foreman/settings.yaml
- - source: salt://foreman/templates/foreman/settings.yaml.jinja
- - template: jinja
- - mode: 644
- Foreman Database:
- file.managed:
- - name: /etc/foreman/database.yml
- - source: salt://foreman/templates/foreman/database.yaml.jinja
- - template: jinja
- - mode: 644
- Foreman Defaults:
- file.managed:
- - name: /etc/default/foreman
- - source: salt://foreman/templates/foreman/defaults.jinja
- - template: jinja
- - mode: 644
- #############################################################################
- ### Everything below is bootstrap bits, other than service.running ##########
- #############################################################################
- Migrate Database:
- cmd.wait:
- - name: foreman-rake db:migrate
- - watch:
- - file: /etc/foreman/database.yml
- # foreman-rake permission:reset username=admin password=changeme
- Set admin password:
- cmd.wait_script:
- - name: salt://certainty/templates/foreman/cmd_setpassword.jinja
- - template: jinja
- - watch:
- - file: /etc/foreman/database.yml
- - username: {{ foreman.server.user }}
- - password: {{ foreman.server.password }}
- Set hammercli password:
- cmd.wait_script:
- - name: salt://certainty/templates/foreman/cmd_setpassword.jinja
- - template: jinja
- - watch:
- - file: /etc/hammer/cli_config.yml
- - username: {{ foreman.hammer.user }}
- - password: {{ foreman.hammer['password'] }}
- - output_loglevel: quiet
- Foreman Running:
- service.running:
- - name: foreman
- - watch:
- - file: /etc/default/foreman
- - file: /etc/foreman/database.yml
- - file: /etc/foreman/settings.yaml
- # hammer location create --name vagrantlab
- # hammer organization create --name development
- # The above will get foreman installed, using sqlite, and listing on port 3000
- # TODO: postgresql support, front end ssl proxy (nginx)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement