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

Commit

Permalink
Fix up pulp_user when installing under vagrant
Browse files Browse the repository at this point in the history
  • Loading branch information
dralley committed Feb 15, 2019
1 parent 514a2ab commit cfca975
Show file tree
Hide file tree
Showing 12 changed files with 79 additions and 29 deletions.
6 changes: 0 additions & 6 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ platforms:
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
command: /usr/sbin/init
- name: fedora-27
image: fedora:27
privileged: True
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
command: /usr/sbin/init
- name: fedora-28
image: fedora:28
privileged: True
Expand Down
4 changes: 2 additions & 2 deletions requirements.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
- src: https://github.com/ehelms/ansible-role-postgresql
version: add-scl-support
- src: https://github.com/dralley/ansible-role-postgresql
version: master
name: geerlingguy.postgresql
34 changes: 34 additions & 0 deletions roles/pulp3-devel/files/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"hosts": [
{
"hostname": "localhost",
"roles": {
"api": {
"port": 8000,
"scheme": "http",
"service": "nginx",
"verify": false
},
"content": {
"port": 8080,
"scheme": "http",
"service": "pulp_content_app",
"verify": false
},
"pulp resource manager": {},
"pulp workers": {},
"redis": {},
"shell": {
"transport": "local"
}
}
}
],
"pulp": {
"auth": [
"admin",
"password"
],
"selinux enabled": false,
"version": "3"
}
8 changes: 0 additions & 8 deletions roles/pulp3-devel/files/venv.bashrc

This file was deleted.

28 changes: 26 additions & 2 deletions roles/pulp3-devel/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,25 @@
virtualenv: '{{ pulp_install_dir }}'
virtualenv_command: '{{ pulp_python_interpreter }} -m venv'

- name: Install pulp-smash for testing locally

- name: Install requirements for testing locally
pip:
requirements: '{{ pulp_source_dir }}/test_requirements.txt'
state: present
virtualenv: '{{ pulp_install_dir }}'
virtualenv_command: '{{ pulp_python_interpreter }} -m venv'

- name: Install requirements for developer scripts
pip:
name: pulp-smash
requirements: '{{ pulp_source_dir }}/dev_requirements.txt'
state: present
virtualenv: '{{ pulp_install_dir }}'
virtualenv_command: '{{ pulp_python_interpreter }} -m venv'

retries: "{{ package_retries }}"
register: result
until: result is succeeded

become: true
become_user: '{{ pulp_user }}'

Expand Down Expand Up @@ -116,6 +129,17 @@
force: yes
mode: 0600

- name: Create pulp-smash config directory if not already present
file:
path: "{{ developer_user_home }}/.config/pulp_smash/"
state: directory
recurse: yes

- name: Create pulp-smash config if not already present
copy:
src: files/settings.json
dest: "{{ developer_user_home }}/.config/pulp_smash/settings.json"

become: true
become_user: "{{ developer_user }}"
#
Expand Down
2 changes: 1 addition & 1 deletion roles/pulp3-devel/templates/alias.bashrc.j2
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pclean() {
workon pulp
pulp-manager reset_db --noinput
pulp-manager migrate
pulp-manager reset-admin-password --password admin
pulp-manager reset-admin-password --password {{ pulp_admin_default_password }}
}
_pclean_help="Restore pulp to a clean-installed state"
# can get away with not resetting terminal settings here since it gets reset in phelp
Expand Down
6 changes: 3 additions & 3 deletions roles/pulp3-postgresql/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ galaxy_info:
- name: Fedora
versions:
- all
- name: Debian
versions:
- stretch
# - name: Debian
# versions:
# - stretch
galaxy_tags:
- pulp3
dependencies:
Expand Down
4 changes: 2 additions & 2 deletions roles/pulp3-postgresql/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

postgresql_databases:
- name: '{{ pulp_database_config["default"]["NAME"] }}'
owner: '{{ pulp_database_config["default"]["NAME"] }}'

postgresql_users:
- name: '{{ pulp_database_config["default"]["USER"] }}'
password: '{{ pulp_database_config["default"]["PASSWORD"] }}'
db: '{{ pulp_database_config["default"]["NAME"] }}'
priv: ALL
role_attr_flags: CREATEDB
7 changes: 4 additions & 3 deletions roles/pulp3/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ galaxy_info:
- name: Fedora
versions:
- all
- name: Debian
versions:
- stretch
# Not supported yet because Debian ships with Python 3.5 (< 3.6 Pulp minimum version)
# - name: Debian
# versions:
# - stretch
galaxy_tags:
- pulp3
- pulpcore
Expand Down
1 change: 1 addition & 0 deletions roles/pulp3/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
shell: '{{ result.stdout.strip() }}'
home: '{{ pulp_var_dir }}'
system: true
when: developer_user is not defined

- name: Create temp dir for Pulp
file:
Expand Down
6 changes: 5 additions & 1 deletion source-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,21 @@
developer_user_home: "/home/vagrant"
package_retries: "5"
pulp_default_admin_password: password
pulp_devel_supplement_bashrc: true
pulp_install_plugins:
# pulp-python:
# app_label: "python"
# source_dir: "/home/vagrant/devel/pulp_python"
# pulp-rpm:
# app_label: "rpm"
# source_dir: "/home/vagrant/devel/pulp_rpm"
pulp-file:
app_label: "file"
source_dir: "/home/vagrant/devel/pulp_file"
pulp_plugin_source_dir: "/home/vagrant/devel/pulpcore-plugin"
pulp_secret_key: "unsafe_default"
pulp_source_dir: "/home/vagrant/devel/pulp"
pulp_devel_supplement_bashrc: true
pulp_user: "vagrant"
pre_tasks:
- name: Set up Vagrant machine for source installs
include: vagrant-pretask.yml
Expand Down
2 changes: 1 addition & 1 deletion vagrant-pretask.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: Make user's home directory world-readable
- name: (Vagrant) Make user's home directory world-readable
file:
path: "{{ ansible_env.HOME }}"
state: directory
Expand Down

0 comments on commit cfca975

Please sign in to comment.