Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gitlab
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ansible
Plugins
gitlab
Commits
5d91cb2c
Commit
5d91cb2c
authored
5 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
Bug fix python 3
parent
61eaf1ec
No related branches found
Branches containing commit
Tags
v0.1.0
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gitlab_host.py
+2
-3
2 additions, 3 deletions
gitlab_host.py
with
2 additions
and
3 deletions
gitlab_host.py
+
2
−
3
View file @
5d91cb2c
...
...
@@ -3,7 +3,6 @@
RETURN
=
'''
#
'''
from
subprocess
import
call
import
string
try
:
import
gitlab
...
...
@@ -73,7 +72,7 @@ def main():
'
namespace_id
'
:
cgroup
.
id
,
})
# Add remote repo to etckeeper git repo
cmd
=
[
'
git
'
,
'
remote
'
,
'
add
'
,
'
origin
'
,
'
%s:ansible-inventories/hosts/%s/%s.git
'
%
(
s
tring
.
replace
(
server_url
,
'
https://
'
,
'
git@
'
),
company
,
hostname
)]
cmd
=
[
'
git
'
,
'
remote
'
,
'
add
'
,
'
origin
'
,
'
%s:ansible-inventories/hosts/%s/%s.git
'
%
(
s
erver_url
.
replace
(
'
https://
'
,
'
git@
'
),
company
,
hostname
)]
call
(
cmd
,
cwd
=
'
/etc
'
)
project
=
git
.
projects
.
get
(
gproject
.
id
)
# type: gitlab.Project
...
...
@@ -83,7 +82,7 @@ def main():
'
can_push
'
:
True
,
})
except
Exception
as
e
:
module
.
fail_json
(
msg
=
"
Creating new host project failed: %s
"
%
e
.
message
,
response
=
e
)
module
.
fail_json
(
msg
=
"
Creating new host project failed: %s
"
%
str
(
e
)
,
response
=
e
)
return
module
.
exit_json
(
changed
=
changed
,
result
=
"
Successfully created project %s/ansible-inventories/hosts/%s/%s
"
%
(
server_url
,
company
,
hostname
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment