From 6031dd621fc9ec3897c761315ec4fb155f70f737 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Sep 14 2015 17:36:57 +0000 Subject: Merge branch 'master' of /git/ansible --- diff --git a/playbooks/manual/staging-sync/templates/koji-reset-staging.sql b/playbooks/manual/staging-sync/templates/koji-reset-staging.sql index 42fecd5..38988db 100644 --- a/playbooks/manual/staging-sync/templates/koji-reset-staging.sql +++ b/playbooks/manual/staging-sync/templates/koji-reset-staging.sql @@ -24,8 +24,6 @@ -- [unset kojihub ServerOffline setting] -BEGIN; - -- bump sequences (not strictly needed anymore) select now() as time, 'bumping sequences' as msg; alter sequence task_id_seq restart with 90000000; @@ -64,14 +62,10 @@ select now() as time, 'expiring repos' as msg; update repo set state = 3 where state in (0, 1, 2); -COMMIT; - - -- add our staging builders, dynamically pulled from ansible inventory {% for host in groups['buildvm-stg'] + groups['koji-stg'] %} -BEGIN; select now() as time, 'adding staging host {{ host }}' as msg; insert into users (name, usertype, status) values ('{{ host }}', 1, 0); insert into host (user_id, name, arches) values ( @@ -80,11 +74,9 @@ insert into host (user_id, name, arches) values ( insert into host_channels (host_id, channel_id) values ( (select id from host where name='{{host}}'), (select id from channels where name='{{channel}}')); {% endfor %} -COMMIT; {% endfor %} {% for host in groups['arm-stg'] %} -BEGIN; select now() as time, 'adding staging host {{ host }}' as msg; insert into users (name, usertype, status) values ('{{ host }}', 1, 0); insert into host (user_id, name, arches) values ( @@ -93,20 +85,17 @@ insert into host (user_id, name, arches) values ( insert into host_channels (host_id, channel_id) values ( (select id from host where name='{{host}}'), (select id from channels where name='{{channel}}')); {% endfor %} -COMMIT; {% endfor %} -- Add some people to be admins, only in staging. Feel free to grow this list.. {% for username in ['ralph', 'imcleod'] %} -BEGIN; select now() as time, 'adding staging admin {{username}}' as msg; insert into user_perms (user_id, perm_id, active, creator_id) values ( (select id from users where name='{{username}}'), (select id from permissions where name='admin'), True, (select id from users where name='{{username}}')); -COMMIT; {% endfor %} VACUUM ANALYZE;