Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
systemsmanagement:chef:10
rubygem-chef
chef-create-amqp-passwd
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File chef-create-amqp-passwd of Package rubygem-chef
#!/bin/bash passwd="/etc/chef/amqp_passwd" if [ ! -e $passwd ]; then /sbin/service rabbitmq-server status &> /dev/null if [ $? -ne 0 ]; then echo "rabbitmq-server not running, can't set password" exit 1 fi echo "Creating $passwd and setting up rabbitmq" dd if=/dev/urandom count=1 bs=18 2>/dev/null | base64 | tr -dc _A-Z-a-z-0-9 > $passwd chmod 600 $passwd chown chef.root $passwd match_for() { rabbitmqctl ${1} | grep chef > /dev/null } match_for "list_users" if [ $? -ne 0 ]; then rabbitmqctl add_user chef `cat $passwd` else rabbitmqctl change_password chef `cat $passwd` fi match_for "list_vhosts" if [ $? -ne 0 ]; then rabbitmqctl add_vhost /chef fi match_for "list_user_permissions" if [ $? -ne 0 ]; then rabbitmqctl set_permissions -p /chef chef ".*" ".*" ".*" fi else echo "$passwd exists, changing nothing" exit 0 fi exit 0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor