Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 39 additions & 5 deletions development/playbooks/deploy-dev/deploy-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@
- "../../../src/vars/base.yaml"
vars:
httpd_foreman_backend: "http://localhost:3000"
roles:
- role: pre_install
- role: certificates
- role: postgresql
vars:
pre_tasks:
- name: Set development postgresql databases
ansible.builtin.set_fact:
postgresql_databases:
- name: "{{ candlepin_database_name }}"
owner: "{{ candlepin_database_user }}"
Expand All @@ -34,6 +32,31 @@
role_attr_flags: SUPERUSER
- name: "{{ pulp_database_user }}"
password: "{{ pulp_database_password }}"

- name: Setup iop requirements
when:
- "'iop' in enabled_features"
block:
- name: Include iop databases
ansible.builtin.include_vars:
file: "../../../src/vars/database_iop.yml"

- name: Combine lists
ansible.builtin.set_fact:
postgresql_databases: "{{ postgresql_databases + iop_postgresql_databases }}"
postgresql_users: "{{ postgresql_users + iop_postgresql_users }}"

- name: Enable foreman_rh_cloud plugin for iop
ansible.builtin.set_fact:
foreman_development_enabled_plugins: "{{ foreman_development_enabled_plugins + ['foreman_rh_cloud'] }}"

- name: Enable foreman_ansible plugin for iop
ansible.builtin.set_fact:
foreman_development_enabled_plugins: "{{ foreman_development_enabled_plugins + ['foreman_ansible'] }}"
roles:
- role: pre_install
- role: certificates
- role: postgresql
- role: redis
- role: candlepin
- role: httpd
Expand All @@ -43,7 +66,18 @@
foreman_development_oauth_consumer_key: "{{ foreman_oauth_consumer_key }}"
foreman_development_oauth_consumer_secret: "{{ foreman_oauth_consumer_secret }}"
foreman_development_candlepin_oauth_secret: "{{ candlepin_oauth_secret }}"
- role: iop_core
when:
- "'iop' in enabled_features"
vars:
iop_core_foreman_oauth_consumer_key: "{{ foreman_oauth_consumer_key }}"
iop_core_foreman_oauth_consumer_secret: "{{ foreman_oauth_consumer_secret }}"
post_tasks:
- name: Stop Foreman development service
ansible.builtin.include_role:
name: foreman_development
tasks_from: stop-server.yml

- name: Display development environment information
ansible.builtin.debug:
msg: |
Expand Down
6 changes: 0 additions & 6 deletions development/roles/foreman_development/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,6 @@
password: "{{ foreman_development_admin_password }}"
ca_path: "{{ foreman_development_ca_certificate }}"

- name: Stop Foreman development service after smart proxy registration
ansible.builtin.systemd:
name: foreman-development
state: stopped
enabled: false

- name: Configure smart-proxy for development
ansible.builtin.include_tasks: smart-proxy/main.yml
when:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,10 @@
oauth1_consumer_key: "{{ foreman_development_oauth_consumer_key }}"
oauth1_consumer_secret: "{{ foreman_development_oauth_consumer_secret }}"
ca_path: "{{ foreman_development_ca_certificate }}"
validate_certs: false

- name: Stop development services after smart proxy registration
- name: Stop smart-proxy-development service
ansible.builtin.systemd:
name: "{{ item }}-development"
name: "smart-proxy-development"
state: stopped
enabled: false
with_items:
- smart-proxy
- foreman
6 changes: 6 additions & 0 deletions development/roles/foreman_development/tasks/stop-server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
- name: Stop foreman-development service
ansible.builtin.systemd:
name: "foreman-development"
state: stopped
enabled: false
1 change: 1 addition & 0 deletions src/roles/iop_gateway/templates/relay.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ proxy_ssl_name "{{ foreman_servername | default(ansible_fqdn) }}";

# URI to forman
# Example of host.containers.internal is the container network gateway.
proxy_set_header Host localhost;
proxy_pass "https://host.containers.internal";