-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathclient.yml
131 lines (113 loc) · 4.24 KB
/
client.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
---
- name: Include initial OS-specific tasks
include_tasks: "init_{{ ansible_os_family | lower }}.yml"
vars:
_cvmfs_role: client
_cvmfs_upgrade: "{{ cvmfs_upgrade_client }}"
- name: Include key setup tasks
include_tasks: keys.yml
- name: Check CernVM-FS for setup
command: cvmfs_config chksetup
changed_when: no
ignore_errors: yes
register: cvmfs_config_chksetup_out
- name: Ensure AutoFS is enabled + running
service:
name: autofs
enabled: yes
state: started
- name: Perform AutoFS and FUSE configuration for CernVM-FS
command: cvmfs_config setup
notify:
- reload autofs
when: 'not ansible_check_mode and "CernVM-FS map is not referenced" in cvmfs_config_chksetup_out.stdout'
- name: Configure CernVM-FS config repository
block:
- name: Create config repo config
copy:
content: |
## This file is maintained by Ansible - CHANGES WILL BE OVERWRITTEN
CVMFS_SERVER_URL="{{ cvmfs_config_repo.urls | join(';') }}"
CVMFS_PUBLIC_KEY="{{ cvmfs_config_repo.key.path }}"
dest: /etc/cvmfs/config.d/{{ cvmfs_config_repo.repository.repository }}.conf
owner: root
group: root
mode: 0444
- name: Set config repo defaults
copy:
content: |
## This file is maintained by Ansible - CHANGES WILL BE OVERWRITTEN
CVMFS_CONFIG_REPOSITORY="{{ cvmfs_config_repo.repository.repository }}"
CVMFS_DEFAULT_DOMAIN="{{ cvmfs_config_repo.domain }}"
CVMFS_USE_GEOAPI="{{ cvmfs_config_repo.use_geoapi | default(false) | ternary('yes', 'no') }}"
dest: /etc/cvmfs/default.d/80-ansible-galaxyproject-cvmfs.conf
owner: root
group: root
mode: 0444
# This is here for transitioning from galaxy_cvmfs_repos_enabled == true config-repo
- name: Remove domain configuration
file:
path: /etc/cvmfs/domain.d/{{ cvmfs_config_repo.domain }}.conf
state: absent
when: cvmfs_config_repo and cvmfs_config_repo_supported
- name: Configure CernVM-FS domain
copy:
content: |
## This file is maintained by Ansible - CHANGES WILL BE OVERWRITTEN
CVMFS_SERVER_URL="{{ item.urls | join(';') }}"
CVMFS_KEYS_DIR=/etc/cvmfs/keys/{{ item.domain }}
CVMFS_USE_GEOAPI="{{ item.use_geoapi | default(false) | ternary('yes', 'no') }}"
dest: /etc/cvmfs/domain.d/{{ item.domain }}.conf
owner: root
group: root
mode: 0444
with_items: "{{ cvmfs_server_urls }}"
- name: Configure CernVM-FS global client settings
copy:
content: |
CVMFS_REPOSITORIES="{%- for repo in cvmfs_repositories -%}{{ ',' if loop.index0 > 0 else '' }}{{ repo.repository }}{%- endfor -%}"
CVMFS_HTTP_PROXY="{{ cvmfs_http_proxies | join(';') }}"
CVMFS_QUOTA_LIMIT="{{ cvmfs_quota_limit | default('4000') }}"
CVMFS_CACHE_BASE="{{ cvmfs_cache_base | default('/var/lib/cvmfs') }}"
dest: "/etc/cvmfs/default.local"
owner: root
group: root
mode: 0644
- name: Include repository client options tasks
include_tasks: options.yml
vars:
_cvmfs_repo_option_key: client
- name: Install cvmfs_wipecache setuid binary
copy:
src: cvmfs_wipecache.{{ _cvmfs_install_setuid_platform }}_{{ ansible_distribution_major_version }}
dest: /usr/local/bin/cvmfs_wipecache
owner: root
group: root
mode: 06755
when: cvmfs_install_setuid_cvmfs_wipecache | bool
- name: Remove cvmfs_wipecache setuid binary
file:
path: /usr/local/bin/cvmfs_wipecache
state: absent
when: not (cvmfs_install_setuid_cvmfs_wipecache | bool)
- name: Install cvmfs_remount_sync setuid binary
copy:
src: cvmfs_remount_sync.{{ _cvmfs_install_setuid_platform }}_{{ ansible_distribution_major_version }}
dest: /usr/local/bin/cvmfs_remount_sync
owner: root
group: root
mode: 06755
when: cvmfs_install_setuid_cvmfs_remount_sync | bool
- name: Remove cvmfs_remount_sync setuid binary
file:
path: /usr/local/bin/cvmfs_remount_sync
state: absent
when: not (cvmfs_install_setuid_cvmfs_remount_sync | bool)
- name: Download cvmfs_preload utility when desired
get_url:
url: https://cvmrepo.s3.cern.ch/cvmrepo/preload/cvmfs_preload
dest: "{{ cvmfs_preload_path }}/cvmfs_preload"
owner: root
group: root
mode: 755
when: cvmfs_preload_install | bool