---
- name: Install required packages
  dnf: name={{ item }} state=present
  with_items:
    - "@pulp-nodes-child"

- name: Set oauth user in nodes.conf
  lineinfile:
      dest: /etc/pulp/nodes.conf
      insertafter: '^\[oauth\]'
      line: 'user_id: {{ oauth_user }}'
      state: present
  notify:
    - Run pulp-manage-db
    - Restart server components

- name: Set parent oauth credentials in nodes.conf
  blockinfile:
      backup: yes
      dest: /etc/pulp/nodes.conf
      insertafter: '^\[parent_oauth\]'
      block: |
        key: {{ oauth_key }}
        secret: {{ oauth_secret }}
        user_id: {{ oauth_user }}
  notify:
    - Run pulp-manage-db
    - Restart server components

---
- name: Install required packages
  dnf: name={{ item }} state=present
  with_items:
    - "@pulp-server-qpid"
    - "@pulp-nodes-child"

- name: Set oauth user in nodes.conf
  lineinfile:
      dest: /etc/pulp/nodes.conf
      insertafter: '^\[oauth\]'
      line: 'user_id: {{ oauth_user }}'
      state: present
  notify:
    - Run pulp-manage-db
    - Restart server components

- name: Set parent oauth credentials in nodes.conf
  blockinfile:
      backup: yes
      dest: /etc/pulp/nodes.conf
      insertafter: '^\[parent_oauth\]'
      block: |
        key: {{ oauth_key }}
        secret: {{ oauth_secret }}
        user_id: {{ oauth_user }}
  notify:
    - Run pulp-manage-db
    - Restart server components

- name: Unset verify_ssl in nodes.conf
  lineinfile:
      dest: /etc/pulp/nodes.conf
      insertafter: '^\[main\]'
      line: 'verify_ssl: False'
      state: present
  notify:
    - Run pulp-manage-db
    - Restart server components

Install pulp-server stuff, disable SSL verify.
Install pulp-server stuff, disable SSL verify.

This setup is in no way usable in a public network.
