Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Ansible Framework Container
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
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
Playbooks
Ansible Framework Container
Commits
9d1371c8
Commit
9d1371c8
authored
9 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
Add playbook farm and improve customer support for playbooks
parent
21f1c315
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ansible-playbook.sh
+21
-14
21 additions, 14 deletions
ansible-playbook.sh
farm.yml
+74
-0
74 additions, 0 deletions
farm.yml
with
95 additions
and
14 deletions
ansible-playbook.sh
+
21
−
14
View file @
9d1371c8
...
...
@@ -8,15 +8,17 @@ cd $( cd $(dirname $(realpath $0)) ; pwd )
if
[
$1
==
"local"
]
then
CUSTOM_DIR
=
false
INVENTORY
=
./local.inventory
shift
else
if
[
-f
./inventory/inventory
]
then
INVENTORY
=
./inventory
/inventory
CUSTOM_DIR
=
./inventory
else
INVENTORY
=
./inventory/
$ANSIBLE_COMPANY
/inventory
fi
CUSTOM_DIR
=
./inventory/
$ANSIBLE_COMPANY
fi
INVENTORY
=
$CUSTOM_DIR
/inventory
fi
if
[
"
$1
"
==
""
]
...
...
@@ -29,16 +31,11 @@ fi
if
[
$1
==
"custom"
]
then
shift
if
[
$INVENTORY
==
"./inventory/inventory"
]
then
PLAYBOOK_PREFIX
=
"./inventory"
else
PLAYBOOK_PREFIX
=
"./inventory/
$ANSIBLE_COMPANY
"
fi
PLAYBOOK_PREFIX
=
$CUSTOM_DIR
/
else
PLAYBOOK_PREFIX
=
"
.
"
PLAYBOOK_PREFIX
=
""
fi
PLAYBOOK
=
$PLAYBOOK_PREFIX
/
$1
.yml
PLAYBOOK
=
$PLAYBOOK_PREFIX$1
.yml
shift
if
[
!
-f
$INVENTORY
]
...
...
@@ -55,7 +52,17 @@ fi
if
[
-f
$SECRETS
]
then
ansible-playbook
$PLAYBOOK
-i
$INVENTORY
-e
@
$SECRETS
"
$@
"
else
ansible-playbook
$PLAYBOOK
-i
$INVENTORY
--ask-sudo-pass
"
$@
"
echo
ansible-playbook
$PLAYBOOK
-i
$INVENTORY
-e
@
$SECRETS
"
$@
"
else
echo
ansible-playbook
$PLAYBOOK
-i
$INVENTORY
--ask-sudo-pass
"
$@
"
fi
if
[
$CUSTOM_DIR
!=
"false"
]
&&
[
"
$CUSTOM_DIR
"
!=
"
$PLAYBOOK_PREFIX
"
]
&&
[
-f
$CUSTOM_DIR
/
$PLAYBOOK
]
then
if
[
-f
$SECRETS
]
then
echo
ansible-playbook
$CUSTOM_DIR
/
$PLAYBOOK
-i
$INVENTORY
-e
@
$SECRETS
"
$@
"
else
echo
ansible-playbook
$CUSTOM_DIR
/
$PLAYBOOK
-i
$INVENTORY
--ask-sudo-pass
"
$@
"
fi
fi
This diff is collapsed.
Click to expand it.
farm.yml
0 → 100644
+
74
−
0
View file @
9d1371c8
##
# Ansible playbook for setting up all hosts at once
#
---
# file: farm.yml
-
include
:
"
validate.yml"
-
name
:
"
Oracle
servers"
hosts
:
"
dbserver-oracle"
sudo
:
yes
roles
:
-
oracle
-
name
:
"
MySqL
servers"
hosts
:
"
dbserver-mysql"
sudo
:
yes
roles
:
-
mysql
-
name
:
"
Drupal
servers"
hosts
:
"
webserver-drupal"
sudo
:
yes
roles
:
-
drupal
-
name
:
"
ownCloud
servers"
hosts
:
"
owncloudserver"
sudo
:
yes
roles
:
-
owncloud
-
name
:
"
Piwik
servers"
hosts
:
"
piwikserver"
sudo
:
yes
roles
:
-
piwik
-
name
:
"
Proxy
servers"
hosts
:
"
proxyserver"
sudo
:
yes
roles
:
-
haproxy
-
name
:
"
Compass
instances"
hosts
:
"
compassinstance"
sudo
:
yes
roles
:
-
compass
-
name
:
"
nodeJS
servers"
hosts
:
"
nodejsserver"
sudo
:
yes
roles
:
-
nodejs
-
name
:
"
SVN
servers"
hosts
:
"
svnserver"
sudo
:
yes
roles
:
-
svnserver
-
name
:
"
APT
proxies"
hosts
:
"
apt-proxy"
sudo
:
yes
roles
:
-
aptproxy
-
name
:
"
OpenPhoto
servers"
hosts
:
"
openphotoserver"
sudo
:
yes
roles
:
-
openphoto
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