Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P455
02-staging-ms-fe.sh
Active
Public
Actions
Authored by
thcipriani
on Mar 30 2015, 6:17 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Referenced Files
F107111: 02-staging-ms-fe.sh
Mar 30 2015, 6:17 PM
2015-03-30 18:17:13 (UTC+0)
Subscribers
None
#!/usr/bin/env bash
info
()
{
printf
"[
$(
tput setaf
4
)
INFO
$(
tput sgr0
)
] %s\n"
"
$@
"
}
die
()
{
printf
"[
$(
tput setaf
1
)
ERROR
$(
tput sgr0
)
] %s\n"
"
$@
"
exit
1
}
info
"You should run 01-staging-ms-fe.sh first!"
printf
'This runs creates the mw:media and swift:dispersion user, OK? [y/N] '
read
ans
if
[
"
$ans
"
!
=
'y'
]
&&
[
"
$ans
"
!
=
'Y'
]
;
then
die
"Answer '
${
ans
}
' is not Y or y, exiting...\n"
fi
if
[
!
"
$(
whoami
)
"
=
'root'
]
;
then
die
"Try rerunning with sudo"
fi
info
"Creating admin user"
curl -sIL -XPOST -H
'X-Auth-Admin-User: .super_admin'
-H
'X-Auth-Admin-Key: [password]'
http://127.0.0.1/auth/v2/.prep
info
"Creating mw account and swift account"
curl -sIL -XPUT -H
'X-Auth-Admin-User: .super_admin'
-H
'X-Auth-Admin-Key: [password]'
http://127.0.0.1:80/auth/v2/mw
curl -sIL -XPUT -H
'X-Auth-Admin-User: .super_admin'
-H
'X-Auth-Admin-Key: [password]'
http://127.0.0.1:80/auth/v2/swift
info
"Creating mw:media user and swift:dispersion user"
curl -sIL -XPUT -H
'X-Auth-Admin-User: .super_admin'
-H
'X-Auth-Admin-Key: [password]'
-H
'X-Auth-User-Key: [mw:media password]'
-H
'X-Auth-User-Admin: true'
http://127.0.0.1:80/auth/v2/mw/media
curl -sIL -XPUT -H
'X-Auth-Admin-User: .super_admin'
-H
'X-Auth-Admin-Key: [password]'
-H
'X-Auth-User-Key: [swift:dispersion password]'
-H
'X-Auth-User-Admin: true'
http://127.0.0.1:80/auth/v2/swift/dispersion
info
"Copy the 'account_id' below into hiera under 'rewrite_account'"
curl -sIL -XGET -H
'X-Auth-Admin-User: .super_admin'
-H
'X-Auth-Admin-Key: [password]'
http://127.0.0.1:80/auth/v2/mw
info
"Run: sudo puppet agent -t; sudo swift-init proxy reload; swift-dispersion-populate"
Event Timeline
thcipriani
edited the content of this paste.
(Show Details)
Mar 30 2015, 6:17 PM
2015-03-30 18:17:13 (UTC+0)
thcipriani
changed the title of this paste from untitled to
02-staging-ms-fe.sh
.
thcipriani
updated the paste's language from
autodetect
to
bash
.
Log In to Comment