-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Aurélien Bompard <[email protected]>
- Loading branch information
Showing
13 changed files
with
197 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,6 +128,7 @@ venv/ | |
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
.vagrant | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[flaskapp] | ||
DEBUG = true | ||
SECRET_KEY = "vagrant-env" | ||
SQLALCHEMY_DATABASE_URI = "sqlite:////home/vagrant/w2fm.db" | ||
|
||
[flaskapp.logsconf] | ||
version = 1 | ||
disable_existing_loggers = false | ||
|
||
[flaskapp.logsconf.handlers] | ||
|
||
[flaskapp.logsconf.handlers.wsgi] | ||
class = "logging.StreamHandler" | ||
stream = "ext://flask.logging.wsgi_errors_stream" | ||
level = "INFO" | ||
formatter = "default" | ||
|
||
[flaskapp.logsconf.formatters] | ||
|
||
[flaskapp.logsconf.formatters.default] | ||
format = "[W2FM] %(asctime)s - %(name)s - %(levelname)s - %(message)s" | ||
datefmt = "[%Y-%m-%d %I:%M:%S %z]" | ||
|
||
[flaskapp.logsconf.root] | ||
handlers = ["wsgi"] | ||
level = "INFO" | ||
|
||
[flaskapp.logsconf.loggers] | ||
|
||
[flaskapp.logsconf.loggers.werkzeug] | ||
handlers = ["wsgi"] | ||
level = "INFO" | ||
propagate = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# SPDX-FileCopyrightText: Contributors to the Fedora Project | ||
# | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
[Unit] | ||
Description=fmn-api | ||
After=network-online.target | ||
Wants=network-online.target | ||
|
||
[Service] | ||
AmbientCapabilities = CAP_NET_BIND_SERVICE | ||
User=vagrant | ||
Environment=GSS_USE_PROXY=yes | ||
Environment=REQUESTS_CA_BUNDLE=/etc/pki/tls/certs/ca-bundle.crt | ||
Environment=W2FM_APPCONFIG=/home/vagrant/config.toml | ||
Environment=PYTHONUNBUFFERED=1 | ||
Environment=FLASK_DEBUG=1 | ||
Environment=FLASK_APP=webhook_to_fedora_messaging.main | ||
WorkingDirectory=/home/vagrant/webhook-to-fedora-messaging | ||
ExecStart=poetry run flask run --reload -p 443 -h "0.0.0.0" --cert=/etc/pki/tls/certs/server.pem --key=/etc/pki/tls/private/server.key | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
krb_service: HTTP | ||
ipa_admin_user: admin | ||
ipa_admin_password: password | ||
krb_master_password: "{{ ipa_admin_password }}" | ||
krb_realm: TINYSTAGE.TEST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
- name: Install RPM packages | ||
dnf: | ||
name: | ||
- gssproxy | ||
state: present | ||
|
||
- name: Get the keytab | ||
import_role: | ||
name: ipa-keytab | ||
vars: | ||
keytab_directory: /var/lib/gssproxy | ||
|
||
- name: Copy gssproxy conf | ||
template: | ||
src: gssproxy.conf | ||
dest: /etc/gssproxy/98-{{ krb_service | lower}}.conf | ||
mode: 0644 | ||
owner: root | ||
group: root | ||
|
||
- name: Enable and restart GSSProxy | ||
systemd: | ||
state: restarted | ||
name: gssproxy | ||
enabled: yes | ||
daemon_reload: yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# | ||
# /etc/gssproxy/99-{{ krb_service }}.conf | ||
# | ||
|
||
[service/{{ krb_service | lower }}] | ||
mechs = krb5 | ||
cred_store = keytab:/var/lib/gssproxy/{{ krb_service }}.keytab | ||
cred_store = client_keytab:/var/lib/gssproxy/{{ krb_service }}.keytab | ||
allow_constrained_delegation = true | ||
allow_client_ccache_sync = true | ||
cred_usage = both | ||
euid = vagrant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
krb_service: HTTP | ||
krb_host_fqdn: "{{ ansible_fqdn }}" | ||
keytab_directory: /etc | ||
keytab_path: "{{ keytab_directory }}/{{ krb_service }}.keytab" | ||
keytab_owner: root | ||
keytab_group: root | ||
ipa_admin_user: admin | ||
ipa_admin_password: password | ||
krb_realm: "{{ ansible_domain | upper }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
- name: Install RPM packages | ||
dnf: | ||
name: | ||
- krb5-workstation | ||
state: present | ||
|
||
- name: kinit | ||
shell: echo "{{ ipa_admin_password }}" | kinit {{ ipa_admin_user }}@{{ krb_realm }} | ||
|
||
- name: Create the service in IPA | ||
command: ipa service-add --force {{ krb_service | upper }}/{{ krb_host_fqdn }} | ||
register: service_add_result | ||
changed_when: "'Added service' in service_add_result.stdout" | ||
failed_when: "not ('Added service' in service_add_result.stdout or 'already exists' in service_add_result.stderr)" | ||
|
||
- name: Allow the host to manage the virtual service | ||
shell: ipa service-add-host --hosts={{ ansible_fqdn }} {{ krb_service | upper }}/{{ krb_host_fqdn }} | ||
when: krb_host_fqdn != ansible_fqdn | ||
register: result | ||
changed_when: '"Number of members added 1" in result.stdout' | ||
failed_when: '(ansible_fqdn + ": This entry is already a member") not in result.stdout and result.rc != 0' | ||
|
||
- name: Get service keytab | ||
shell: ipa-getkeytab -p {{ krb_service | upper }}/{{ krb_host_fqdn }}@{{ krb_realm }} -k {{ keytab_path }} | ||
args: | ||
creates: "{{ keytab_path }}" | ||
|
||
- name: Set the correct permissions on keytab | ||
file: | ||
path: "{{ keytab_path }}" | ||
owner: "{{ keytab_owner }}" | ||
group: "{{ keytab_group }}" | ||
mode: 0640 |
Empty file.
This file was deleted.
Oops, something went wrong.