diff options
-rw-r--r-- | files/openshift/mongo-acct.sh | 7 | ||||
-rw-r--r-- | tasks/openshift-el6.yml | 18 |
2 files changed, 23 insertions, 2 deletions
diff --git a/files/openshift/mongo-acct.sh b/files/openshift/mongo-acct.sh new file mode 100644 index 000000000..15e8973e0 --- /dev/null +++ b/files/openshift/mongo-acct.sh @@ -0,0 +1,7 @@ +#!/bin/bash +mongo stickshift_broker_dev --eval 'db.addUser("stickshift", "mooo")' +mongo stickshift_broker_dev --eval 'db.auth_user.update({"_id":"admin"}, {"_id":"admin","user":"admin","password":"2a8462d93a13e51387a5e607cbd1139f"} , true)' +echo "Acct setup done on `date`" > /etc/mongo-acct-setup + + +
\ No newline at end of file diff --git a/tasks/openshift-el6.yml b/tasks/openshift-el6.yml index 875b5eb85..ceb5997e1 100644 --- a/tasks/openshift-el6.yml +++ b/tasks/openshift-el6.yml @@ -56,12 +56,26 @@ action: copy src=$files/openshift/mongodb.conf dest=/etc/mongodb.conf backup=true tags: - mongo + - name: mongod service start action: service name=mongod state=running enabled=yes tags: - mongo -- name: setup openshift mongo pw - action: command mongo stickshift_broker_dev --eval \'db.addUser("stickshift", "mooo")\' + +- name: mongo/openshift account setup script + action: template src=$files/openshift/mongo-acct.sh dest=/root/mongo-acct.sh mode=0700 + tags: + - mongo + +- name: mongo/openshift account setup + action: command /root/mongo-acct.sh + creates: /etc/mongo-acct-setup tags: - mongo +- name: clear file mongo acct file + action: file state=absent /root/mongo-acct.sh + tags: + - mongo + + |