Comments (16)
I'd prefer Semaphore to read the settings from the file so I don't have to maintain them in one more place.
Also I have far more settings in there, those are just the most important.
I think the solution to cd
somewhere first would make most sense, maybe a config option like working directory
or something?
Has been suggested in #1984, too.
from semaphore.
Not directly a solution for loading the ansible.cfg, but all mentioned configs you guys try to apply you should be able to change via environment variables.
from semaphore.
Similar Issue for me, looks like Semaphore is creating an empty ansible.cfg in /tmp/semaphore/ansible.cfg you can over-mount from the host as a workarround.
I attempted this, but it still ignores it.
I Use exec'ed in to the container and checked the contents of /tmp/semaphore/ansible.cfg after volume mounting it. I see my ansible.cfg file there, but Semaphore still ignores it.
from semaphore.
Not directly a solution for loading the ansible.cfg, but all mentioned configs you guys try to apply you should be able to change via environment variables.
But each project + playbook is creating new folder in which ansible.cfg is stored. For this solution to work i would need to make new enviroment for each playbook in project and set its path to correct one.
Solution i found so far is to create enviromental variable ANSIBLE_CONFIG = /tmp/semaphore/repository_3_*
[SEMAPHORE_PLAYBOOK_PATH] + 'repository_' +[REPOSITORY NUMBER] + '_*' to get config from any repository that is already checked out.
But this works until you edit something in config - you would need to clear all checked out repositories to make sure it loads config from last commit
from semaphore.
I am also setting up Semaphore for the first time and testing it out, I am running into the same issue. I have a folder structure where separate internal and external roles and this is set in the ansible.cfg
└── roles
├── external
└── internal
[defaults]
roles_path = roles/internal:roles/external:roles
from semaphore.
Similar Issue for me, looks like Semaphore is creating an empty ansible.cfg in /tmp/semaphore/ansible.cfg you can over-mount from the host as a workarround.
from semaphore.
Similar issue here. Just getting started with Semaphore, so I might be missing a setting or something.
I got a repository that contains a subfolder with all the ansible stuff, something like this:
repo/
repo/av2/
repo/av2/ansible.cfg
repo/av2/inventory/
repo/av2/plays/
repo/av2/plays/ansible.cfg
repo/av2/plugins/
repo/av2/roles/
Where repo/av2/ansible.cfg
contains this:
[defaults]
inventory = ./inventory/
roles_path = ./roles/:/etc/ansible/roles/
filter_plugins = ./plugins/filter/
vault_password_file = ./.ansible.vault.pass.txt
And repo/av2/plays/ansible.cfg
contains this:
[defaults]
inventory = ../inventory/
roles_path = ../roles/:/etc/ansible/roles/
filter_plugins = ../plugins/filter/
vault_password_file = ../.ansible.vault.pass.txt
It works fine on my workstation but Semaphore seems to be ignoring the ansible.cfg
files; I have a task setup to execute a playbook at repo/av2/plays/full.yml
that immediately fails when including roles from repo/av2/roles/
:
11:45:45 AM
TASK [system] ******************************************************************
11:45:45 AM
ERROR! the role 'system' was not found in /tmp/semaphore/repository_2_5/av2/plays/roles:/tmp/semaphore/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/tmp/semaphore/repository_2_5/av2/plays
11:45:45 AM
11:45:45 AM
The error appears to be in '/tmp/semaphore/repository_2_5/av2/plays/full.yml': line 8, column 15, but may
11:45:45 AM
be elsewhere in the file depending on the exact syntax problem.
11:45:45 AM
11:45:45 AM
The offending line appears to be:
11:45:45 AM
11:45:45 AM
ansible.builtin.include_role:
11:45:45 AM
name: "system"
11:45:45 AM
^ here
from semaphore.
I just saw that #1036 suggests that ansible.cfg
has to be located in the repository root. The Ansible documentation just states it reads ansible.cfg
from the "current directory".
Is there a way to tell Semaphore to cd av2/
first?
from semaphore.
I tested with an ansible.cfg
like this at the root of the repository:
[defaults]
inventory = ./av2/inventory/
roles_path = ./av2/roles/:/etc/ansible/roles/
filter_plugins = ./av2/plugins/filter/
vault_password_file = ./av2/.ansible.vault.pass.txt
Still does not work, same error. So Semaphore seems to be ignoring the config completely?
Running v2.9.113-beta
.
from semaphore.
Hey guys thank's for your interest in this issue, I confirm as I said in my first post that my ansible.cfg
is also in the root of my repository, and that it works fine on my laptop.
Not directly a solution for loading the ansible.cfg, but all mentioned configs you guys try to apply you should be able to change via environment variables.
@tboerger thank for your advice, I'm gonna try this as a workaround !
However I agree with @davidwinterstein I think it would be great to manage general Ansible config in a file in the repo, that would be easier to port and maintain in my opinion.
from semaphore.
Same issue, I have my own custom ansible.cfg and since recent semaphore update all stop working. Inventory cannot find the proper ssh keys.
from semaphore.
Same issue here.
ansible.cfg contains this line:
roles_path = /opt/ansiblectrl/roles:./roles:roles
which worked just fine on v.2.9.75, but isnt working anymore on v.2.9.112.
ERROR! the role 'aptUpdate' was not found in /tmp/semaphore/repository_1_1/playbooks/roles: /tmp/semaphore/.ansible/roles: /usr/share/ansible/roles: /etc/ansible/roles: /tmp/semaphore/repository_1_1/playbooks
from semaphore.
Same issue here. ansible.cfg contains this line:
roles_path = /opt/ansiblectrl/roles:./roles:roles
which worked just fine on v.2.9.75, but isnt working anymore on v.2.9.112.
ERROR! the role 'aptUpdate' was not found in /tmp/semaphore/repository_1_1/playbooks/roles: /tmp/semaphore/.ansible/roles: /usr/share/ansible/roles: /etc/ansible/roles: /tmp/semaphore/repository_1_1/playbooks
In effect the version v2.9.75 works with my ansible repository and makes use of my ansible.cfg
👍 I might need to stick to that version until this is fixed.
from semaphore.
Same issue here. ansible.cfg contains this line:
roles_path = /opt/ansiblectrl/roles:./roles:roles
which worked just fine on v.2.9.75, but isnt working anymore on v.2.9.112.
ERROR! the role 'aptUpdate' was not found in /tmp/semaphore/repository_1_1/playbooks/roles: /tmp/semaphore/.ansible/roles: /usr/share/ansible/roles: /etc/ansible/roles: /tmp/semaphore/repository_1_1/playbooks
In effect the version v2.9.75 works with my ansible repository and makes use of my
ansible.cfg
👍 I might need to stick to that version until this is fixed.
I am just very happy that I encountered this bug in my homelab, where I can just go back to using ansible CLI.
I am going to stay on v.2.9.75 in my work production setup for now...
from semaphore.
Similar Issue for me, looks like Semaphore is creating an empty ansible.cfg in /tmp/semaphore/ansible.cfg you can over-mount from the host as a workarround.
I attempted this, but it still ignores it.
I Use exec'ed in to the container and checked the contents of /tmp/semaphore/ansible.cfg after volume mounting it. I see my ansible.cfg file there, but Semaphore still ignores it.
Works for me on the current 2.9.112 Docker Image at least, but I didn't set an EnvVar for the Config anywhere else.
from semaphore.
Not directly a solution for loading the ansible.cfg, but all mentioned configs you guys try to apply you should be able to change via environment variables.
Could you elaborate on this? I am not sure I understand what you mean here?
from semaphore.
Related Issues (20)
- Problem: Installation of Python Modules via requirements.txt doesnt seem to work as intended HOT 4
- Problem: The size of the Docker images has grown massively since >= v2.9.92 HOT 8
- Problem: web_host missing in slack alert title_link HOT 1
- Question: implement unconventional cron expressions as schedule
- Problem: connect to LDAP/LDAPS from Docker
- Problem: Current Develop Docker Build breaking SSH Hostkey Checking HOT 4
- Problem: .deb package should depend on ansible HOT 4
- Feature: Ability to assign multiple inventories to a task template
- Problem: slack environment variables are not working for docker HOT 1
- Problem: incorrect task link in email alerts
- Problem: After updating to v2.10.2: "Permission denied (publickey,password)" HOT 14
- Problem: Runner console not updating with NGINX reverse proxy HOT 1
- Question: Why relogin after browser close? HOT 4
- Managers should be able to add users to a project and give them permissions of 'Task Runner' or lower
- Snap package's internal ansible never upgrades. HOT 1
- Problem: ansible-semaphore-9.5.0 2.10 - bad boolean environment value '0
- Feature: Allow specifying differenct Credentials for Inventory Git Repos
- Feature: Please add a way to import an external RootCA for LDAPS for Docker
- Question: Why ssh: [email protected]: Permission denied . can't change to another user to run bash script? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from semaphore.