Skip to content

Commit 038892d

Browse files
committed
path finding for relativ requests with custom inv fix
1 parent 8d4e286 commit 038892d

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
run: |
4040
mkdir -p test_playbooks test_job_storage
4141
touch test_inventory.ini
42-
- name: create test playbook
42+
- name: Create test playbook
4343
working-directory: ${{ github.workspace }}/src
4444
run: |
4545
cat << EOF > test_playbooks/test_playbook.yml
@@ -55,8 +55,12 @@ jobs:
5555
- name: Show structure and files
5656
working-directory: ${{ github.workspace }}/src
5757
run: |
58+
pwd
59+
echo "LS --------------------"
5860
ls -R
61+
echo "CONFIG --------------------"
5962
cat config.yml
63+
echo "PLAYBOOK --------------------"
6064
cat test_playbooks/test_playbook.yml
6165
- name: Run tests
6266
run: |

src/ansible_link.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def validate_playbook_request(data, config):
8585
if 'inventory' in data:
8686
inventory_path = Path(data['inventory'])
8787
if not inventory_path.is_absolute():
88-
inventory_path = Path(config['playbook_dir']) / inventory_path
88+
inventory_path = Path(__file__).parent.absolute() / inventory_path
8989
else:
9090
inventory_path = Path(config['inventory_file'])
9191

@@ -244,7 +244,7 @@ class AnsiblePlaybook(Resource):
244244
def post(self):
245245
try:
246246
data = api.payload
247-
247+
logger.debug(f"Received /playbook request: {data}")
248248
validation_errors = validate_playbook_request(data, config)
249249
if validation_errors:
250250
logger.error(f"Validation errors: {validation_errors}")

0 commit comments

Comments
 (0)