Skip to content

Instantly share code, notes, and snippets.

@techzilla
Created August 25, 2016 04:29
Show Gist options
  • Save techzilla/0c62bcb87a6cfa5c8ab219839a2e36c1 to your computer and use it in GitHub Desktop.
Save techzilla/0c62bcb87a6cfa5c8ab219839a2e36c1 to your computer and use it in GitHub Desktop.
#!/bin/sh
##
## FILE: pulp-autocreate.sh
##
## DESCRIPTION: Auto Create Mirror Repositories
##
REPO_ARGS='
--repo-id=remi-7-x86_64 --feed "http://mirror5.layerjet.com/remi/enterprise/7/remi/x86_64/"
--repo-id=remi-7-x86_64-safe --feed "http://mirror5.layerjet.com/remi/enterprise/7/safe/x86_64/"
--repo-id=remi-7-x86_64-php70 --feed "http://mirror5.layerjet.com/remi/enterprise/7/php70/x86_64/"
--repo-id=remi-6-x86_64 --feed "http://mirror5.layerjet.com/remi/enterprise/6/remi/x86_64/"
--repo-id=remi-6-x86_64-safe --feed "http://mirror5.layerjet.com/remi/enterprise/6/safe/x86_64/"
--repo-id=remi-6-x86_64-php70 --feed "http://mirror5.layerjet.com/remi/enterprise/6/php70/x86_64/"
--repo-id=nginx-7-x86_64 --feed "http://nginx.org/packages/rhel/7/x86_64/"
--repo-id=nginx-6-x86_64 --feed "http://nginx.org/packages/rhel/6/x86_64/"
--repo-id=epel-6-x86_64 --relative-url=epel/6/x86_64/ --feed "https://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=x86_64"
--repo-id=epel-7-x86_64 --relative-url=epel/7/x86_64/ --feed "https://mirrors.fedoraproject.org/mirrorlist?repo=epel-7&arch=x86_64"
'
## Exit Point
die() {
[ -n "$2" ] && echo "$2"
exit $1
}
pulp-admin status >/dev/null 2>&1 || {
die 78 "Error, Pulp-Admin Not Authenticated"
}
##
echo "$REPO_ARGS" | xargs -L1 pulp-admin rpm repo create --generate-sqlite=true --repoview=true
echo "$REPO_ARGS" | cut -d ' ' -f1 | xargs -L1 pulp-admin rpm repo sync schedules create -s P1DT
#echo "$REPO_ARGS" | cut -d ' ' -f1 | xargs -L1 pulp-admin rpm repo sync run
die 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment