Skip to content

Commit

Permalink
Unprivileged CVMFS updating for Test/Main
Browse files Browse the repository at this point in the history
  • Loading branch information
natefoo committed Jun 3, 2016
1 parent fd36eee commit 9e8c599
Show file tree
Hide file tree
Showing 16 changed files with 248 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ansible.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ transport = ssh
[ssh_connection]

# enable pipelining with OpenSSH
#pipelining = True
pipelining = True

# These are necessary for cloud instances
#pipelining = False
Expand Down
2 changes: 1 addition & 1 deletion common_roles
3 changes: 3 additions & 0 deletions galaxyenv/group_vars/cvmfsstratum0servers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---

cvmfs_manage_units_group: docker
20 changes: 20 additions & 0 deletions galaxyenv/group_vars/cvmfsstratum1servers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,23 @@

# in MB
cvmfs_stratum1_cache_mem: 3072

group_users:
- name: g2test
uid: 819456
gid: 803372
comment: "Galaxy Test"
home: /home/g2test
shell: /bin/bash
- name: g2main
uid: 819800
gid: 803372
comment: "Galaxy Main"
home: /home/g2main
shell: /bin/bash

group_groups:
- name: G-803372
gid: 803372

cvmfs_manage_units_group: G-803372
4 changes: 4 additions & 0 deletions galaxyenv/inventory
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ westvleteren.galaxyproject.org
leeroy.galaxyproject.org
mjolnir0.galaxyproject.org
duvel.galaxyproject.org
cvmfs0-tacc0.galaxyproject.org ansible_user=root
cvmfs1-tacc0.galaxyproject.org ansible_user=centos ansible_become=yes
cvmfs1-iu0.galaxyproject.org ansible_user=centos ansible_become=yes
cvmfs1-psu0.galaxyproject.org ansible_user=root

# These get LDAP, Kerberos+Auth, and NFS, but not AFS
[liteenv]
Expand Down
54 changes: 54 additions & 0 deletions galaxyenv/secret_host_vars/cvmfs1-iu0.galaxyproject.org.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
$ANSIBLE_VAULT;1.1;AES256
35646639353661333335643264336633393238646235616138383537303433383563313033313566
6165316439623136346436376431656538313638633130330a646433656437323765303636643532
37633066613339613864326336643037666239336332636464323063613938656331653632313631
3136373538386232610a303763323265373964343736616664383466373539623135366337326664
62363433396334373863616662306330323731666138623239343032306665303835623137646432
39353430333634633761333166363834316338323931366431623263336132656131646338633838
31323931613665343862376239316336656230373431663435356437396533326433316239636435
36383664396635386434323639383635333264656238633562343966386465616334346639633466
61323430366561336434333630343031663037383333383331303831306239336237373031616236
36633764363263623836626137633333396563353833323132633230633537646561616131623064
62653632613031653731356565363364363736333464313962313936383464636661313435316331
32306136363031303037346264356564653864356237336361656430613261623265366234646363
36383362643336313964623734383334356636363238333939363262383265343863396536333132
66313364643939333865306335663838633637343131666231303337316439616636646364623835
30353032636637623565616234656664336465326333333862383235313735353836346437616134
66313138363763656665663563656637303430656663373732316265336634643930373965396366
36663061393164633966613739633138626164646436343437373763346135336462396138323536
33663336383438613535393163666436636139303030666332643338656531363837353836376630
66373738376262623163333762306364613962333932363331336337616530626165383265626633
39626565616135666631346162653838356166356437346230343335663438356465343864383133
61316336653431393837656466306164386661303865393864336562323864663936353033616662
33383436336161396532323931656565336461616633303735353864353237316438633639656135
30323137393331306232393037663661346332366134633538343433373632626530336163343334
36653463643839333461653535306163386665613166653136306330643364396338643362666663
34316639333931616436636532336162306635616166363433613332393937386639633664393635
33653466653133393562333138353234343537356662386531346431613737626666303135646638
31633661376331653336323164346466303661303937633165633162633866386232353165626663
35373030313165623664623963643838653463343563663663343362663961643630306265326362
37653036626534343736313438383833363037376437663463626339653037626262313534623865
32663763353536376338643832313736663939396437633138356533323535633530326564656538
63333661316431373465623539636132396530303034326532353766653538316466316632333535
34353562613934663032646333346438353063313537363837666362353736656139333732633163
65643533626635393865393432353864613734343965666339386236363533396564383132353036
33633866353633343864616563353362396635653233393637626136636237396463353538666430
37663666346339613836323563383064636335616366353237633730316264333836663163356563
32326333656534373161333930306331373733363833353461653466393130393364333330326237
33353433383130613966353065656439393235343163396537353633356661636333626435623662
62666366633430356263633437616636646339653630346231623936623632313735646637633164
39333732633965663966663430643233663132623961356265646138333937326635386439363663
63663339633266333436383462323634393564336339326433373430363837323066383639663730
32646466346566323263386666363963356531656230353039373265386530303462306466353933
61363262376331626466383930613966653963646432373436626338646138643835393865316233
65623635643065663330383966343931343666636162363938626566323837336239636137363034
36346331643462646636353663326662636564626563353939353561316436633130333932383535
64653037396338333631393333316662306233643334613131633865633135336537353462323538
39343364343365386438356636326166343038653833353839336661383735346138323835353339
35623538626332306633656534386339386333613734313938306233643863643231636462396337
32666163613964616134653439303061306138306265303235343935636664633064363961383865
34326532313130366131356339636463373134626333313662353439396531333130316134303033
62333964633662306236333837336632366136633961326431373162316165376362303462363634
32353930633964616233333763363437363230373937306534306234623466663130613037656636
34346365326566353937623231303432386166323163633836623162333635316336626437333237
6565
54 changes: 54 additions & 0 deletions galaxyenv/secret_host_vars/cvmfs1-psu0.galaxyproject.org.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
$ANSIBLE_VAULT;1.1;AES256
34313030373135666232663733656236656439643234333636316530383738383931323937653335
3538313934613936356638393064306561383561626664640a343362303961353536393035383761
64323636353061363330333462303533646533373232633131396535356339343263633537323462
3038386461396564300a393336636338313634333038383233336462356564376666346533323832
39363531656439633238643337333439666431626462353431383762333432613137393136653863
63383336353663396139623264653831626236636434633231636566323338316635386333393765
34313064393161613934366263366236346666343966326338356433643463356466343161313466
33663965613964313961626664303361363064323361663037353264393030623439333937646164
62666330363038653134633032643163653239326365396366343265613934313930626562383431
35333138633436616232343563346665333137356433643230643766323031383438373366343265
66343438656462386162383033393662366162633865373031313736623737666437363536393235
31383666643765626638326233626337663963366637656363656139323962336331393534646136
35363938316163306337393464613236313239313130363532303561323436393662356135383832
36626330383565633539333561353466336436323031363862366336623032316630336365306231
39636439626237333434633164653136323266653438363833333230376561646565393463653137
36333436646339666631383037366665653366663037643135633030376663663661333865663161
63323066376665316561366263633735643336656461376331643031356361323037383332383831
31306166313565656563343462636163383566333237353264643764363964623834636432623134
35313736383036343364333362393838396662633265396432346536373432613237336233383536
35613933626263623135616133613261383236303261653265303638333935643037343835376138
62393734346234353335393162623634326234663339663133653637393336633336353962636166
30396561366565303231313363663932376535633930366137613264356462636538303537383334
37636463313164353430313765366565393236323335356138363632333863393062363637386562
36643736363565396637306530366530336264626139333033663961303835393133366263393562
65616166316539376537313164303139386365303034373231616166353135346135373939383331
61323865643936623734643932666333336661613739663363313634623435353231386534376466
64333438643532663834346238356464613034353261373063323635623232663139633636663739
32333638393939383961653364636532303439396230356638306135353634313463346338313263
65353761653532316333383063346665306366316438663262366536623537306131353564383736
37366630333862323562343066326362313532373861333335346261616639393035343631356464
36616538356532646335653637663939303634383539333533386335633537366135643932336635
61643432616230376337653333393039386536636465363133323765356361383232343664663461
34393261653464383431653535306333656163366363313062363463313631633139616534383062
34316134666366326538656339366664333339303765633461323361306566366432646530656365
62383637653536316233636138366564613332343561663236363430653638356365363765346165
65323537306532666537376235316531303231373163323333363638643864383338336363316434
34363839376663353536373235636234633231373938663031383235353066303837373738373239
32356662616530366230323065626234383835333165653561373535366339646637333564336363
65396432353532356536346661356430623765643430373637373661626132396336303362306166
62313130643437303761313834636237386536613561653937663835653463383033303138333133
34306233366665643262386630356135633530666331626566346561396230626366313561383136
35353463633139373432323832633634626435646331363264636235326262663762663362353131
32386437353734386635396631306566613730393236646535363065373837323431663461353539
63386636633034323162333732343731643633376362663236633839336530336364313338313237
34336137666161373562343865363930346634363237363163353662363035663433306533303830
31663739373962303138646662626461656466643262393337663664326234383535616234396630
61643833323835663838356465616538623231316164303539373231333838336530623664313661
66323066353762353630386661326665616232343638323764343361343431356637666266646362
31656164336436653031373961373539353932616563363030626531626264623564313635663430
61343935376331356330393064636366616234353662643834636166613763376533396236653535
65393761643361616532393632333661323765396338393435663562623836353335636665386332
38666130353239656433316539653239653637343734353033366365663161313238343664316536
6664
54 changes: 54 additions & 0 deletions galaxyenv/secret_host_vars/cvmfs1-tacc0.galaxyproject.org.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
$ANSIBLE_VAULT;1.1;AES256
62623932643836396162313362626532323762613336376538643236353735613036373434373239
3066393838373833303239653161646661626162333766660a343262346462306436623330643532
61366165616631336337646134346537353831303366656263616339656236333533646434643064
6435656131353731370a323464346361623432633965353065396337663265633539303634316439
34336137323632633536333637303164343965613738383662616437656434623535366530383339
30326462303161386630336530333237303335306130643963666131366238313637343239376537
66653939326534653561366164666339623034643263316631343138336261313864353162376532
35393565306333643330656130346433653133363234316161653764643663663835303931346436
63613030616363333133616465316465393262373035333035666133373761653265386665393534
65613332613433316561653737383165643838333061343266663766353838636335383832666464
39306432323538316239613835356665636662386532623865383566363161613839616635653932
39353761323236643536373439326638666333613638396663356362613538663133346331363661
33616165363630643565333233343563666564383431663736653938633064663765616132616330
32633131316565613766613631646361383062613362663833343633343232616134316531336237
38303431353632376362623237326232326132663064626134316233313262303964346436633034
66643535343936623133663131663035646132393637343363633239376661663433303733353934
66333932323232383732313437626361356532313234653262306430383261376333653166663637
35613731376338306136396431636163373633343666336539613562653165316561343863623561
39323139303463643633326362393263393934366235646234663439626135643439363136323935
34636164326535656138633531616265333735363565613330326166336331626435643764346363
38333564316135336364356136333931393932613432393732333561653862396331356433323030
66363361643665626633313132376331376536613263646430656466303661326238336632646137
64396631396632363564643337623136616466333534383564376435333837333839336434646534
31633962623061616331636130656462356131613366373835336635383030356539353665303165
34366234386637343465306362376239346264306436353162383333393034643035666537303335
31323064303966386339653039333636383634336261613263383166366533383333333162336531
63383965396264363531393462306134363861343235326166633936333462376137666362333436
64353263643266613038343132616565616236326632333831373835343733373632666438326434
33313032346334663730643030643030653732373732356231303435363232626464666531323963
32346232623934666438386566303837306635613735356335343966633436386561373137346162
39333238316163373339373532643231636263316633656166663333366631323031393134643165
66313961616332343464346565346638363463623330306563316231623538653333393235626662
65636238316638393932323461386632626565366665346333636366656133653930613739346463
34626631333666383637306663646630316362643762303661623337633139303465363131383931
31383438633031376366306539343365663233663762343231663266363030663637313835643561
64396139653239303938626361616434396636303035373230633265636538663232316236333339
61373466386565626532663739303537303466333163333837343366623765313366326464616137
35396163386138366366643039633062626665396661623162653335333732346335653665656336
32623665636432386238653165623765643263633530386533323531383362623037646361333334
39333033346139666465303235333963643333386630336366323132326139623635363431626661
65316662616361343164643432356239396365306438373365396661393738373766633035343338
38323931313362653038356139373465333733313163396136336163393932623737646631626635
65393466323463316137386636616362616337303533636632633635323665323466643636623263
31356131343130653539333137393265373838303462356565303137386137313831613138653435
61386231303935336133383636333333613036306664633538393238646361376561643636653438
37356437366437363732316232623537643837396337653734383633616535326136656237616162
34656130393539316161386634306236613266346261366562383166363135353266643935646338
30613265373835333435653939613231386536383337396233346236666232383865643236323133
64633366313533386562663330623839336465303138666339326539313164626438313061396338
63613231323964323264623562396361663664306431343539383034346666306338323339386466
33373235336666613438343863653132393564616564373966383532303131373433336533646264
61353331353637643338313365336135363239613961316461363765393662333264616535316636
3165
3 changes: 3 additions & 0 deletions roles/cvmfs/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,6 @@ cvmfs_stratum1_servers:
cvmfs_stratum1_apache_port: 8008
# in MB
cvmfs_stratum1_cache_mem: 128

# Install a setuid binary allowing unprivileged users to call `cvmfs_config wipecache`?
cvmfs_install_setuid_cvmfs_wipecache: no
13 changes: 13 additions & 0 deletions roles/cvmfs/files/cvmfs_wipecache.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* setuid binary for calling cvmfs_config wipecache
*/

#include <stdlib.h>
#include <unistd.h>

int main(int argc, char *argv[]) {
// must set the real uid (cvmfs_config checks it)
setreuid(0, 0);
if (execle("/usr/bin/cvmfs_config", "cvmfs_config", "wipecache", NULL) < 0)
perror("cvmfs_wipecache: ");
}
Binary file added roles/cvmfs/files/cvmfs_wipecache.centos_6
Binary file not shown.
9 changes: 9 additions & 0 deletions roles/cvmfs/tasks/client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,12 @@
owner: "root"
group: "root"
mode: "0644"

- name: Install cvmfs_wipecache setuid binary
copy:
src: cvmfs_wipecache.{{ ansible_distribution | lower }}_{{ ansible_distribution_major_version }}
dest: /usr/local/bin/cvmfs_wipecache
owner: root
group: root
mode: 06755
when: cvmfs_install_setuid_cvmfs_wipecache
8 changes: 8 additions & 0 deletions roles/cvmfs/tasks/stratum0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
state: enabled
permanent: yes
immediate: yes
# Some hosts may not be using firewalld
ignore_errors: true

- name: Ensure repositories exist for import
stat:
Expand All @@ -82,3 +84,9 @@
with_subelements:
- "{{ cvmfs_repositories }}"
- server_options

- name: Allow users to manage services
template:
src: 01-manage-units.rules.j2
dest: /etc/polkit-1/rules.d/01-manage-units.rules
when: cvmfs_manage_units_group is defined
7 changes: 7 additions & 0 deletions roles/cvmfs/tasks/stratum1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
state: enabled
permanent: yes
immediate: yes
ignore_errors: true

- name: Ensure replicas are configured
command: /usr/bin/cvmfs_server add-replica -z -o {{ item.owner | default('root') }} http://{{ item.stratum0 }}/cvmfs/{{ item.repository }} /etc/cvmfs/keys/{{ item.repository }}.pub
Expand All @@ -84,3 +85,9 @@
minute: 0,15,30,45
user: root
with_items: "{{ cvmfs_repositories }}"

- name: Allow users to manage services
template:
src: 01-manage-units.rules.j2
dest: /etc/polkit-1/rules.d/01-manage-units.rules
when: cvmfs_manage_units_group is defined
15 changes: 15 additions & 0 deletions roles/cvmfs/templates/01-manage-units.rules.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* This file is managed by Ansible. ALL CHANGES WILL BE OVERWRITTEN.
*/

/* Allow users in the docker group to manage units. Way more control than we
* would like to give, but the "unit" and "verb" action variables (used with
* action.lookup()) were not added to systemd until 226, so unless RedHat
* backports them, we are SOL.
*/
polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.systemd1.manage-units" &&
subject.isInGroup("{{ cvmfs_manage_units_group }}")) {
return polkit.Result.YES;
}
});
2 changes: 2 additions & 0 deletions taccenv/group_vars/galaxyservers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ cvmfs_server_urls:

cvmfs_http_proxies:
- "DIRECT"

cvmfs_install_setuid_cvmfs_wipecache: yes

0 comments on commit 9e8c599

Please sign in to comment.