Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove git playbooks requirement #327

Closed
jasonculligan opened this issue Apr 19, 2017 · 11 comments
Closed

Remove git playbooks requirement #327

jasonculligan opened this issue Apr 19, 2017 · 11 comments

Comments

@jasonculligan
Copy link

I try to create a playbook, for example to run apt-get update on some servers, but I cannot access any part of semaphore that will allow me to create this playbook.

@matejkramny
Copy link
Contributor

matejkramny commented Apr 19, 2017 via email

@jasonculligan
Copy link
Author

v2.3, Ubuntu 16.04 LTS 64bit. No error specifically but I cannot locate where to enter the contents of my playbook.

@matejkramny
Copy link
Contributor

matejkramny commented Apr 19, 2017 via email

@jasonculligan
Copy link
Author

ok - so for "Playbook repository" in "Templates" I can enter /etc/ansible/playbooks (where I will keep playbooks), and I need to have "/etc/ansible/playbooks/playbook.yml" present before I can config playbook.yml as the "Playbook name" in the "templates"?

@matejkramny
Copy link
Contributor

For the most basic template, with a local git directory:

  • Create an ssh key (can be the ssh key to access the inventory)
  • Create a repository, pointing "Repository" field to the local folder (note: must be a server git repository - init with git init --bare then commit to it)
  • Create an inventory which your playbook will access
  • Create a template with given repository and use things created above ^

@jasonculligan
Copy link
Author

I'm missing the git part. I don't use git to store my playbooks, just plain .yml files. Is this mandatory for semaphore?

@matejkramny
Copy link
Contributor

Unfortunately it is, you could just use a local git server..

example:

# create a git repo
git init && git add --all && git commit -m "fc"
# create server git repo
mkdir -p /tmp/my_git.git && cd /tmp/my_git.git
# init repository
git init --bare
# go back to original folder
cd -
# add local origin
git remote add origin /tmp/my_git.git
# push to local folder
git push origin master

now point semaphore to /tmp/my_git.git and it will work. Just remember to update the local git repository after changing files.

I know why this is a pain, fortunately we can make this easier ;)

@matejkramny matejkramny mentioned this issue Apr 19, 2017
22 tasks
@matejkramny matejkramny changed the title Cannot create playbooks Remove git playbooks requirement Apr 19, 2017
@thedumbtechguy
Copy link

While this is irrelevant to your post, you really should manage your playbooks with Git.
You can create a private repo on Gitlab for free for this purpose.

The drawback I find is when testing these playbooks. As I work in a windows environment, I have to change -> commit -> push -> run.

@raja24790
Copy link

raja24790 commented May 1, 2024

i have done the above steps but still getting below error

automation@auhdcvhiste02:/opt/project/playbooks$ sudo git push origin master
Enumerating objects: 13, done.
Counting objects: 100% (13/13), done.
Delta compression using up to 16 threads
Compressing objects: 100% (13/13), done.
Writing objects: 100% (13/13), 3.87 KiB | 1.29 MiB/s, done.
Total 13 (delta 7), reused 0 (delta 0), pack-reused 0
To /tmp/my_git.git

  • [new branch] master -> master

error:

11:43:02 AM
Task 2147483622 added to queue
11:43:03 AM
Started: 2147483622
11:43:03 AM
Run TaskRunner with template: upgrade_test_servers
11:43:03 AM
Preparing: 2147483622
11:43:03 AM
Failed in finding static repository at /tmp/my_git.git: stat /tmp/my_git.git: no such file or directory
11:43:03 AM
Running playbook failed: stat /tmp/my_git.git: no such file or directory

@fiftin
Copy link
Collaborator

fiftin commented May 1, 2024

Hi @raja24790 what you want to do?

@raja24790
Copy link

Hi @raja24790 what you want to do?

I want to use my local repository which i have made in /opt/project/playbooks. But I am not able to configure it in semaphore. I tried every method mentioned.

I did all this also

create a git repo

git init && git add --all && git commit -m "fc"

create server git repo

mkdir -p /tmp/my_git.git && cd /tmp/my_git.git

init repository

git init --bare

go back to original folder

cd -

add local origin

git remote add origin /tmp/my_git.git

push to local folder

git push origin master

Then i added path in repository as /tmp/my_git.git but yet it is giving the error "Failed in finding static repository at /tmp/my_git.git: stat /tmp/my_git.git: no such file or directory

Could you please share detailed steps. Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants
@matejkramny @fiftin @thedumbtechguy @jasonculligan @raja24790 and others