Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Adds pulp-content role for the pulp_content_app #64

Merged
merged 2 commits into from
Jan 24, 2019
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
1 change: 1 addition & 0 deletions molecule/default/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
- pulp3-workers
- pulp3-resource-manager
- pulp3-webserver
- pulp3-content
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A+

16 changes: 16 additions & 0 deletions roles/pulp3-content/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
pulp3-content
=============

Install, configure, and set the state of pulp content app.

Copy link
Contributor

@asmacdo asmacdo Jan 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should also document the pulp_content_app variable even though it has a default.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using and documenting the variable, I removed it

Shared variables:
-----------------

* `ansible_python_interpreter`: **Required**. Path to the Python interpreter.

This role **is not tightly coupled** with the `pulp3` role, but it does use some of the same
variables. When used together, the values are inherited from the role. When not used together,
these values are **required**.

* `pulp_user`
* `pulp_install_dir`
7 changes: 7 additions & 0 deletions roles/pulp3-content/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
- name: Reload systemd and restart pulp content app
systemd:
daemon_reload: true
name: pulp_content_app.service
state: restarted
become: true
11 changes: 11 additions & 0 deletions roles/pulp3-content/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
galaxy_info:
author: Pulp
description: Pulp content app
company: Red Hat
min_ansible_version: 2.4
platforms:
- name: Fedora
versions:
- 28
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since our tests use f27 and centos, I think we should include them too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realize that you probably did it this way to mirror the workers role, which is also missing those platforms. Would you mind changing that as well while we are thinking about it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fedora 27 is end of life, IMO we should disinclude it both here and with the tests, and use F28+

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

license: GPL-3.0
18 changes: 18 additions & 0 deletions roles/pulp3-content/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
- block:
- name: Install pulp_content_app service file
template:
src: pulp_content_app.service.j2
dest: /lib/systemd/system/pulp_content_app.service
owner: root
group: root
mode: 0644
notify: Reload systemd and restart pulp content app

- name: Set state of pulp content app
systemd:
daemon_reload: true
name: pulp_content_app.service
state: started
enabled: true
become: true
21 changes: 21 additions & 0 deletions roles/pulp3-content/templates/pulp_content_app.service.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[Unit]
Description=Pulp Content App
After=network-online.target
Wants=network-online.target

# This service will break if left running while PostgreSQL restarts.
BindsTo=postgresql.service
After=postgresql.service

[Service]
Environment="DJANGO_SETTINGS_MODULE=pulpcore.app.settings"
User={{ pulp_user }}
WorkingDirectory=/var/run/pulp_content_app/
RuntimeDirectory=pulp_content_app
ExecStart={{ pulp_install_dir }}/bin/gunicorn pulpcore.content:server \
--bind 'localhost:8080' \
--worker-class 'aiohttp.GunicornWebWorker' \
-w 2

[Install]
WantedBy=multi-user.target
1 change: 1 addition & 0 deletions source-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@
- pulp3-workers
- pulp3-resource-manager
- pulp3-webserver
- pulp3-content
- pulp3-devel
1 change: 1 addition & 0 deletions user-sandbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@
- pulp3-workers
- pulp3-resource-manager
- pulp3-webserver
- pulp3-content