Merge pull request 'Create dirs for repo and add pypiserver service' (#49) from dev into master
Reviewed-on: https://remvpn.olssonul.com/iac/rproxy/pulls/49
This commit is contained in:
@@ -14,6 +14,36 @@
|
||||
path: "{{ repo_data_dir }}"
|
||||
state: directory
|
||||
|
||||
- name: "Create {{ repo_data_dir }}/archive"
|
||||
ansible.builtin.file:
|
||||
path: "{{ repo_data_dir }}/archive"
|
||||
state: directory
|
||||
|
||||
- name: "Create {{ repo_data_dir }}/pip"
|
||||
ansible.builtin.file:
|
||||
path: "{{ repo_data_dir }}/pip"
|
||||
state: directory
|
||||
|
||||
- name: "Create {{ repo_data_dir }}/pip/py3"
|
||||
ansible.builtin.file:
|
||||
path: "{{ repo_data_dir }}/pip/py3"
|
||||
state: directory
|
||||
|
||||
- name: "Create {{ repo_data_dir }}/repo"
|
||||
ansible.builtin.file:
|
||||
path: "{{ repo_data_dir }}/repo"
|
||||
state: directory
|
||||
|
||||
- name: "Create {{ repo_data_dir }}/repo/almalinux"
|
||||
ansible.builtin.file:
|
||||
path: "{{ repo_data_dir }}/repo/almalinux"
|
||||
state: directory
|
||||
|
||||
- name: "Create {{ repo_data_dir }}/repo/almalinux/10"
|
||||
ansible.builtin.file:
|
||||
path: "{{ repo_data_dir }}/repo/almalinux/10"
|
||||
state: directory
|
||||
|
||||
- name: Create sites dir
|
||||
ansible.builtin.file:
|
||||
path: "{{ rproxy_dir }}/sites"
|
||||
|
||||
@@ -17,4 +17,8 @@
|
||||
|
||||
- name: Repository install
|
||||
ansible.builtin.include_tasks:
|
||||
file: repo.yml
|
||||
file: repo.yml
|
||||
|
||||
- name: Pypi repository install
|
||||
ansible.builtin.include_tasks:
|
||||
file: pypi.yml
|
||||
17
roles/rproxy/tasks/pypi.yml
Normal file
17
roles/rproxy/tasks/pypi.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
- name: Install pypi-server
|
||||
ansible.builtin.pip:
|
||||
name:
|
||||
- pypiserver
|
||||
|
||||
- name: Copy pypi-server service file
|
||||
ansible.builtin.template:
|
||||
src: "templates/pypiserver.service.j2"
|
||||
dest: "/etc/systemd/system/pypiserver.service"
|
||||
|
||||
- name: Enable pypiserver service
|
||||
ansible.builtin.systemd:
|
||||
name: "pypiserver.service"
|
||||
state: started
|
||||
enabled: yes
|
||||
daemon_reload: yes
|
||||
17
roles/rproxy/templates/pypiserver.service.j2
Normal file
17
roles/rproxy/templates/pypiserver.service.j2
Normal file
@@ -0,0 +1,17 @@
|
||||
[Unit]
|
||||
Description=PyPI Server (pypiserver)
|
||||
After=network.target
|
||||
Wants=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory={{ repo_data_dir }}/pip/py3
|
||||
ExecStart=/usr/bin/python3 -m pypiserver -p 10000 -o {{ repo_data_dir }}/pip/py3
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
ReadWriteDirectories={{ repo_data_dir }}/pip/py3
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user