forked from ansible-community/ara-collection
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial rip from ansible-community#69, will work on adding Podman Qua…
…dlets now
- Loading branch information
1 parent
ed9eb47
commit 2dd2f8d
Showing
7 changed files
with
85 additions
and
11 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
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
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: Detecting existing PyPI installation | ||
ansible.builtin.stat: | ||
path: "{{ ara_api_venv_path }}" | ||
register: existing_pypi_install | ||
|
||
- name: Notify about existing PyPI installation | ||
ansible.builtin.debug: | ||
msg: | | ||
You seem to have ARA-API installed via PyPI in the past, you might | ||
want to clean up that installation and migrate your data | ||
when: existing_pypi_install['stat']['exists'] | ||
|
||
- name: Override file locations with path in container | ||
ansible.builtin.set_fact: | ||
ara_api_database_name: "/opt/ara/ansible.sqlite" | ||
ara_api_log_dir: "/opt/ara/logs" | ||
ara_api_settings: "{{ ara_api_root_dir }}/settings.yaml" | ||
|
||
# TODO: Insert podman quadlet magic here | ||
|
||
- name: Ensure service | ||
ansible.builtin.systemd: | ||
name: ara-api.service | ||
state: started | ||
enabled: true | ||
daemon_reload: true |
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,31 @@ | ||
--- | ||
# Copyright (c) 2020 The ARA Records Ansible authors | ||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) | ||
|
||
- name: Deploy and test ARA API with podman | ||
hosts: ara-api-server | ||
gather_facts: yes | ||
vars: | ||
ara_api_install_method: podman | ||
ara_api_version: latest | ||
ara_api_root_dir: "{{ ansible_user_dir }}/.ara-tests" | ||
ara_api_secret_key: testing | ||
ara_api_debug: true | ||
ara_api_log_level: DEBUG | ||
# Configure cleanup crons to exercise the code path during tests | ||
ara_api_configure_cron: true | ||
tasks: | ||
- name: Install podman | ||
become: yes | ||
package: | ||
name: podman | ||
state: present | ||
|
||
- name: Set up the API with the ara_api Ansible role | ||
include_role: | ||
name: ara_api | ||
public: yes | ||
|
||
# These are tasks rather than a standalone playbook to give us an easy | ||
# access to all the variables within the same play. | ||
- include_tasks: test_tasks.yaml |