Koji staging sync: remove hosts from DB prior to adding them
Some staging hosts already exist in production Koji (they were added by mistake?), either as hosts or pure users, but can be removed.
This commit is contained in:
parent
7eaec29885
commit
cda638a3fe
1 changed files with 10 additions and 0 deletions
|
@ -75,6 +75,8 @@ update repo set state = 3 where state in (0, 1, 2);
|
|||
-- The koji hub is x86_64 and i386 and has createrepo ability
|
||||
{% for host in groups['koji-stg'] %}
|
||||
select now() as time, 'adding staging host {{ host }}' as msg;
|
||||
delete from host where name='{{ host }}';
|
||||
delete from users where name='{{ host }}';
|
||||
insert into users (name, usertype, krb_principal, status) values ('{{ host }}', 1, 'compile/{{ host }}@STG.FEDORAPROJECT.ORG', 0);
|
||||
insert into host (user_id, name, arches) values (
|
||||
(select id from users where name='{{host}}'), '{{host}}', 'i386 x86_64');
|
||||
|
@ -87,6 +89,8 @@ insert into host_channels (host_id, channel_id) values (
|
|||
-- The buildvms are x86_64 and i386 and also have createrepo ability
|
||||
{% for host in groups['buildvm-stg'] %}
|
||||
select now() as time, 'adding staging host {{ host }}' as msg;
|
||||
delete from host where name='{{ host }}';
|
||||
delete from users where name='{{ host }}';
|
||||
insert into users (name, usertype, krb_principal, status) values ('{{ host }}', 1, 'compile/{{ host }}@STG.FEDORAPROJECT.ORG', 0);
|
||||
insert into host (user_id, name, arches) values (
|
||||
(select id from users where name='{{host}}'), '{{host}}', 'i386 x86_64');
|
||||
|
@ -100,6 +104,8 @@ insert into host_channels (host_id, channel_id) values (
|
|||
|
||||
{% for host in groups['buildvm-aarch64-stg'] %}
|
||||
select now() as time, 'adding staging host {{ host }}' as msg;
|
||||
delete from host where name='{{ host }}';
|
||||
delete from users where name='{{ host }}';
|
||||
insert into users (name, usertype, krb_principal, status) values ('{{ host }}', 1, 'compile/{{ host }}@STG.FEDORAPROJECT.ORG', 0);
|
||||
insert into host (user_id, name, arches) values (
|
||||
(select id from users where name='{{host}}'), '{{host}}', 'aarch64');
|
||||
|
@ -113,6 +119,8 @@ insert into host_channels (host_id, channel_id) values (
|
|||
|
||||
{% for host in groups['buildvm-ppc64-stg'] %}
|
||||
select now() as time, 'adding staging host {{ host }}' as msg;
|
||||
delete from host where name='{{ host }}';
|
||||
delete from users where name='{{ host }}';
|
||||
insert into users (name, usertype, krb_principal, status) values ('{{ host }}', 1, 'compile/{{ host }}@STG.FEDORAPROJECT.ORG', 0);
|
||||
insert into host (user_id, name, arches) values (
|
||||
(select id from users where name='{{host}}'), '{{host}}', 'ppc64');
|
||||
|
@ -126,6 +134,8 @@ insert into host_channels (host_id, channel_id) values (
|
|||
|
||||
{% for host in groups['buildvm-ppc64le-stg'] %}
|
||||
select now() as time, 'adding staging host {{ host }}' as msg;
|
||||
delete from host where name='{{ host }}';
|
||||
delete from users where name='{{ host }}';
|
||||
insert into users (name, usertype, krb_principal, status) values ('{{ host }}', 1, 'compile/{{ host }}@STG.FEDORAPROJECT.ORG', 0);
|
||||
insert into host (user_id, name, arches) values (
|
||||
(select id from users where name='{{host}}'), '{{host}}', 'ppc64le');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue