From 7aa6365096747e7ec933b78b1fc7338f704bb6a1 Mon Sep 17 00:00:00 2001 From: Seth Vidal Date: Wed, 10 Oct 2012 20:01:39 +0000 Subject: [PATCH] add a mongo-acct script template - to be populated with passwords, etc later --- files/openshift/mongo-acct.sh | 7 +++++++ tasks/openshift-el6.yml | 18 ++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 files/openshift/mongo-acct.sh diff --git a/files/openshift/mongo-acct.sh b/files/openshift/mongo-acct.sh new file mode 100644 index 0000000000..15e8973e00 --- /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 875b5eb85d..ceb5997e1e 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 + +