From cdf686a38fef4613d8b7ed88ee7b5416bb13fb33 Mon Sep 17 00:00:00 2001
From: Karel van Klink <karel.vanklink@geant.org>
Date: Tue, 11 Apr 2023 14:34:29 +0200
Subject: [PATCH] Rename to LARP

---
 Jenkinsfile                              | 2 +-
 README.md                                | 4 ++--
 docs/dump-openapi-spec.py                | 4 ++--
 docs/source/conf.py                      | 2 +-
 docs/source/index.rst                    | 2 +-
 docs/source/quickstart.rst               | 8 ++++----
 {ansible_api => larp}/__init__.py        | 6 +++---
 {ansible_api => larp}/app.py             | 6 +++---
 {ansible_api => larp}/config.py          | 0
 {ansible_api => larp}/environment.py     | 0
 {ansible_api => larp}/routes/__init__.py | 0
 {ansible_api => larp}/routes/default.py  | 2 +-
 setup.py                                 | 6 +++---
 tox.ini                                  | 2 +-
 14 files changed, 22 insertions(+), 22 deletions(-)
 rename {ansible_api => larp}/__init__.py (91%)
 rename {ansible_api => larp}/app.py (67%)
 rename {ansible_api => larp}/config.py (100%)
 rename {ansible_api => larp}/environment.py (100%)
 rename {ansible_api => larp}/routes/__init__.py (100%)
 rename {ansible_api => larp}/routes/default.py (83%)

diff --git a/Jenkinsfile b/Jenkinsfile
index 490b869..dfc196d 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -1,3 +1,3 @@
 library 'SWDPipeline'
 
-SimplePythonBuild('goat-ansible-api');
+SimplePythonBuild('goat-larp');
diff --git a/README.md b/README.md
index 80a0129..62845f7 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
-# Ansible API
+# Lightweight Ansible Runner Provisioner
 
-And API that allows for remotely executing Ansible playbooks
+LARP: an API that allows for remotely executing Ansible playbooks
 
 ## Running locally
 
diff --git a/docs/dump-openapi-spec.py b/docs/dump-openapi-spec.py
index c1d36bd..eae0df9 100644
--- a/docs/dump-openapi-spec.py
+++ b/docs/dump-openapi-spec.py
@@ -2,7 +2,7 @@ import json
 import os
 
 from fastapi.testclient import TestClient
-import ansible_api
+import larp
 
 config_filename = os.path.join(
     os.path.dirname(__file__),
@@ -13,7 +13,7 @@ output_filename = os.path.join(
     'source', '_static', 'openapi.json')
 
 os.environ['SETTINGS_FILENAME'] = config_filename
-app = ansible_api.create_app()
+app = larp.create_app()
 client = TestClient(app)
 rsp = client.get('/openapi.json')
 openapi_doc = json.dumps(rsp.json(), indent=2)
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 56936a1..9d63df7 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -48,7 +48,7 @@ def setup(app):
 
 # -- Project information -----------------------------------------------------
 
-project = 'Ansible API'
+project = 'Lightweight Ansible Runner Provisioner'
 copyright = '2023, GÉANT'
 author = 'GÉANT Orchestration & Automation Team'
 
diff --git a/docs/source/index.rst b/docs/source/index.rst
index f3b3481..66746d3 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -1,7 +1,7 @@
 GOAT Ansible API
 ==========================
 
-Documentation for the GOAT Ansible API
+Documentation for LARP: a Lightweight Ansible Runner Provisioner
 
 .. toctree::
    :maxdepth: 1
diff --git a/docs/source/quickstart.rst b/docs/source/quickstart.rst
index 81b9962..f7ce68c 100644
--- a/docs/source/quickstart.rst
+++ b/docs/source/quickstart.rst
@@ -15,7 +15,7 @@ Install the Module
     python3 -m venv my-venv-directory
     . my-venv-directory/bin/activate
 
-    pip install --pre --extra-index-url https://artifactory.software.geant.org/artifactory/api/pypi/geant-swd-pypi/simple goat-ansible-api
+    pip install --pre --extra-index-url https://artifactory.software.geant.org/artifactory/api/pypi/geant-swd-pypi/simple goat-larp
 
 * Install the source code
 
@@ -24,8 +24,8 @@ Install the Module
     python3 -m venv my-venv-directory
     . my-venv-directory/bin/activate
 
-    git clone https://gitlab.geant.org/goat/gap/ansible-api.git
-    cd ansible-api
+    git clone https://gitlab.geant.org/goat/gap/larp.git
+    cd larp
     pip install -e .
 
     # for a full dev environment
@@ -39,7 +39,7 @@ Running the App
 
   .. code-block:: bash
 
-     SETTINGS_FILENAME=/absolute/path/to/config.json python -m ansible_api.app
+     SETTINGS_FILENAME=/absolute/path/to/config.json python -m goat_larp.app
 
 Examples
 
diff --git a/ansible_api/__init__.py b/larp/__init__.py
similarity index 91%
rename from ansible_api/__init__.py
rename to larp/__init__.py
index 2b5f258..33ccfb7 100644
--- a/ansible_api/__init__.py
+++ b/larp/__init__.py
@@ -6,10 +6,10 @@ import logging
 from fastapi import FastAPI
 from fastapi.middleware.cors import CORSMiddleware
 
-from ansible_api import environment
-from ansible_api import config
+from larp import environment
+from larp import config
 
-from ansible_api.routes import default
+from larp.routes import default
 
 
 def create_app():
diff --git a/ansible_api/app.py b/larp/app.py
similarity index 67%
rename from ansible_api/app.py
rename to larp/app.py
index e542ca1..5f36943 100644
--- a/ansible_api/app.py
+++ b/larp/app.py
@@ -1,14 +1,14 @@
 """
 default app creation
 """
-import ansible_api
+import larp
 
-app = ansible_api.create_app()
+app = larp.create_app()
 
 if __name__ == "__main__":
     import uvicorn
     uvicorn.run(
-        'ansible_api.app:app',
+        'larp.app:app',
         host='0.0.0.0',
         port=44444,
         log_level='debug')
diff --git a/ansible_api/config.py b/larp/config.py
similarity index 100%
rename from ansible_api/config.py
rename to larp/config.py
diff --git a/ansible_api/environment.py b/larp/environment.py
similarity index 100%
rename from ansible_api/environment.py
rename to larp/environment.py
diff --git a/ansible_api/routes/__init__.py b/larp/routes/__init__.py
similarity index 100%
rename from ansible_api/routes/__init__.py
rename to larp/routes/__init__.py
diff --git a/ansible_api/routes/default.py b/larp/routes/default.py
similarity index 83%
rename from ansible_api/routes/default.py
rename to larp/routes/default.py
index ec22b66..51809b9 100644
--- a/ansible_api/routes/default.py
+++ b/larp/routes/default.py
@@ -18,5 +18,5 @@ def version() -> Version:
     return {
         'api': API_VERSION,
         'module':
-            pkg_resources.get_distribution('goat-ansible-api').version
+            pkg_resources.get_distribution('goat-larp').version
     }
diff --git a/setup.py b/setup.py
index 985cea1..061160c 100644
--- a/setup.py
+++ b/setup.py
@@ -1,12 +1,12 @@
 from setuptools import setup, find_packages
 
 setup(
-    name='goat-ansible-api',
+    name='goat-larp',
     version='0.0.1',
     author='GÉANT Orchestration & Automation Team',
     author_email='TBD',
-    description='GOAT Ansible API',
-    url='https://gitlab.geant.org/goat/gap/ansible-api',
+    description='Lightweight Ansible Runner Provioner',
+    url='https://gitlab.geant.org/goat/gap/larp',
     packages=find_packages(),
     install_requires=[
         'jsonschema',
diff --git a/tox.ini b/tox.ini
index af515ea..3a9b917 100644
--- a/tox.ini
+++ b/tox.ini
@@ -10,7 +10,7 @@ deps =
 
 commands =
     coverage erase
-    coverage run --source ansible_api -m pytest
+    coverage run --source larp -m pytest
     coverage xml
     coverage html
     coverage report --fail-under 80
-- 
GitLab