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

Commit

Permalink
Adds pulp-content role for the pulp_content_app
Browse files Browse the repository at this point in the history
  • Loading branch information
dkliban committed Jan 16, 2019
1 parent ed0a45e commit 8afa0a4
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 0 deletions.
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
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.

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

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

This role **is not tightly coupled** with the `pulp3-postgresql` 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`
4 changes: 4 additions & 0 deletions roles/pulp3-content/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
pulp_content_app:
state: started
enabled: true
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
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 @@
---
- 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
become: true

- name: Set state of pulp content app
systemd:
daemon_reload: true
name: pulp_content_app.service
state: started
enabled: true
become: true
23 changes: 23 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,23 @@
[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]
EnvironmentFile=-/etc/default/pulp_workers
EnvironmentFile=-/etc/default/pulp_workers_%i
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 @@ -25,4 +25,5 @@
- pulp3-workers
- pulp3-resource-manager
- pulp3-webserver
- pulp3-content
- pulp3-devel

0 comments on commit 8afa0a4

Please sign in to comment.