Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in / Register
Toggle navigation
O
opstheater
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
opstheater
opstheater
Commits
81cbbd79
Commit
81cbbd79
authored
Jun 02, 2017
by
Walter Heck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial work on setting up a yum repo server locally
parent
48bab738
Pipeline
#398
passed with stages
in 3 minutes and 14 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
92 additions
and
0 deletions
+92
-0
deploy/vagrant-oscar/config/vms.yaml
deploy/vagrant-oscar/config/vms.yaml
+10
-0
deploy/vagrant-oscar/files/setup-repo.sh
deploy/vagrant-oscar/files/setup-repo.sh
+82
-0
No files found.
deploy/vagrant-oscar/config/vms.yaml
View file @
81cbbd79
...
@@ -30,6 +30,16 @@ vms:
...
@@ -30,6 +30,16 @@ vms:
-
foss-puppet-agent-rhel7
-
foss-puppet-agent-rhel7
-
managed-host
-
managed-host
## repo server
-
name
:
repo
box
:
puppetlabs/centos-7.2-64-nocm
private_networks
:
[
{
ip
:
'
10.20.1.70'
}
]
hostname
:
repo.opstheater.vm
roles
:
-
foss-puppet-agent-rhel7
-
managed-host
-
memory-4g
## elasticsearch + kibana
## elasticsearch + kibana
-
name
:
elasticsearch
-
name
:
elasticsearch
box
:
puppetlabs/centos-7.2-64-nocm
box
:
puppetlabs/centos-7.2-64-nocm
...
...
deploy/vagrant-oscar/files/setup-repo.sh
0 → 100644
View file @
81cbbd79
#!/bin/bash
echo
"Running setup-repo.sh"
# colorize some of the output, see http://dcmnt.me/1XYnkPe for more information
COLOR_OK
=
$(
tput setaf 2
)
COLOR_ERR
=
$(
tput setaf 1
)
COLOR_OFF
=
$(
tput sgr0
)
COLOR_BRIGHT
=
$(
tput bold
)
SIGN_OK
=
"
${
COLOR_OFF
}
${
COLOR_OK
}
✓
${
COLOR_OFF
}
"
SIGN_ERR
=
"
${
COLOR_OFF
}
${
COLOR_ERR
}
✗
${
COLOR_OFF
}
"
function
log
{
case
$2
in
norm
)
message
=
"
${
COLOR_BRIGHT
}${
1
}${
COLOR_OFF
}
"
;;
ok
)
message
=
"
${
COLOR_OK
}${
1
}${
COLOR_OFF
}
"
;;
err
)
message
=
"
${
COLOR_ERR
}${
1
}${
COLOR_OFF
}
"
;;
esac
echo
"
$message
"
>
&2
}
#convert all hyphens and forward slashes to underscore
PUPPET_ENV
=
$(
echo
$GIT_BRANCH
|
tr
'.\-/'
_
)
log
"==> stopping firewalld service"
norm
if
[
-f
/usr/lib/systemd/system/firewalld.service
]
;
then
service firewalld stop
||
{
log
"==>
$SIGN_ERR
failed to stop firewalld service"
err
;
exit
1
;
}
elif
[
-f
/usr/lib/systemd/system/iptables.service
]
;
then
service iptables stop
||
{
log
"==>
$SIGN_ERR
failed to stop iptables service"
err
;
exit
1
;
}
else
log
"no firewalld or iptables service found"
norm
fi
log
"==>
$SIGN_OK
OK:stopping firewalld service"
ok
# log "==> installing necessary yum repositories and foreman-installer" norm
# if rpm -q puppetlabs-release-pc1-el-7; then
# log "==> puppetlabs-release-pc1-el-7 already installed, skipping" norm
# else
# rpm -ivh https://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm || { log "==> $SIGN_ERR failed to install puppetlabs pc1 rpm" err; exit 1; }
# fi
#
# if rpm -q epel-release; then
# log "==> epel-release already installed, skipping" norm
# else
# yum -y install epel-release || { log "==> $SIGN_ERR failed to install epel-release" err; exit 1; }
# fi
#
# if rpm -q foreman-release; then
# log "==> foreman-release already installed, skipping" norm
# else
# yum -y install https://yum.theforeman.org/releases/1.13/el7/x86_64/foreman-release.rpm || { log "==> $SIGN_ERR failed to install foreman-release" err; exit 1; }
# fi
# log "==> stopping firewalld service" norm
# if [ -f /usr/lib/systemd/system/firewalld.service ]; then
# service firewalld stop || { log "==> $SIGN_ERR failed to stop firewalld service" err ; exit 1; }
# elif [ -f /usr/lib/systemd/system/iptables.service ]; then
# service iptables stop || { log "==> $SIGN_ERR failed to stop iptables service" err; exit 1; }
# else
# log "no firewalld or iptables service found" norm
# fi
# log "==> $SIGN_OK OK:stopping firewalld service" ok
# log "==> running puppet agent" norm
# /opt/puppetlabs/bin/puppet agent -t --detailed-exitcodes
# if [ $? == 4 ] || [ $? == 6 ]; then
# log "==> $SIGN_ERR puppet agent run encountered errors" err
# exit 1
# fi
# log "==> $SIGN_OK OK: running puppet agent" ok
#
# /opt/puppetlabs/bin/puppet resource service firewalld ensure=stopped enable=false
# echo "Finishing setup-foss-master.sh"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment