Add support for glusterfs mounts
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/837706 Change-Id: I2631e6f00011942954be7c776e3c99a11bdfb28d
This commit is contained in:
parent
c3d4f26ed1
commit
d74c88dcb5
@ -65,5 +65,8 @@ systemd_default_mount_options: 'defaults'
|
|||||||
# type: "fuse.s3fs"
|
# type: "fuse.s3fs"
|
||||||
# options: "url=https://s3-{{aws_region}}.amazonaws.com,_netdev,allow_other,use_path_request_style"
|
# options: "url=https://s3-{{aws_region}}.amazonaws.com,_netdev,allow_other,use_path_request_style"
|
||||||
# credentials: "ACCESS_KEY_ID:SECRET_ACCESS_KEY"
|
# credentials: "ACCESS_KEY_ID:SECRET_ACCESS_KEY"
|
||||||
|
# - what: gluster-server:gluster-volume-name
|
||||||
|
# where: /mnt/shared_storage
|
||||||
|
# type: glusterfs
|
||||||
|
|
||||||
systemd_mounts: []
|
systemd_mounts: []
|
||||||
|
@ -50,3 +50,41 @@
|
|||||||
package:
|
package:
|
||||||
name: "{{ systemd_mount_packages }}"
|
name: "{{ systemd_mount_packages }}"
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
|
# NOTE(jrosser) as we call systemd_service from inside a block: with a when:
|
||||||
|
# parameter, the when: condition must be able to be resolved inside the
|
||||||
|
# systemd_service role where role vars from systemd_mount are not in scope
|
||||||
|
- name: Make boolean flag for setting up glusterfs
|
||||||
|
set_fact:
|
||||||
|
_configure_glusterfs: "{{ 'glusterfs' in systemd_mount_types }}"
|
||||||
|
|
||||||
|
- name: Configure fuse for glusterfs
|
||||||
|
when:
|
||||||
|
- _configure_glusterfs
|
||||||
|
block:
|
||||||
|
- name: Configure systemd-tmpfiles to create /dev/fuse at boot
|
||||||
|
copy:
|
||||||
|
content: "c /dev/fuse 0600 - - - 10:229"
|
||||||
|
dest: "/etc/tmpfiles.d/openstack-ansible-systemd_mount-glusterfs-client.conf"
|
||||||
|
register: _glusterfs_server_tmpfiles
|
||||||
|
|
||||||
|
- name: Apply systemctl overrides
|
||||||
|
when: ansible_facts['pkg_mgr'] == 'dnf'
|
||||||
|
include_role:
|
||||||
|
name: systemd_service
|
||||||
|
vars:
|
||||||
|
systemd_services:
|
||||||
|
- service_name: systemd-tmpfiles-setup-dev
|
||||||
|
restart_changed: false
|
||||||
|
load: false
|
||||||
|
systemd_overrides_only: true
|
||||||
|
systemd_overrides:
|
||||||
|
Unit:
|
||||||
|
ConditionCapability: ""
|
||||||
|
|
||||||
|
- name: Restart systemd-tmpfiles-setup-dev
|
||||||
|
service:
|
||||||
|
name: "systemd-tmpfiles-setup-dev"
|
||||||
|
state: restarted
|
||||||
|
when:
|
||||||
|
- _glusterfs_server_tmpfiles is changed
|
@ -6,3 +6,6 @@ systemd_ceph_packages:
|
|||||||
|
|
||||||
systemd_s3_packages:
|
systemd_s3_packages:
|
||||||
- s3fs
|
- s3fs
|
||||||
|
|
||||||
|
systemd_glusterfs_packages:
|
||||||
|
- glusterfs-client
|
||||||
|
@ -34,4 +34,7 @@ systemd_mount_packages: |-
|
|||||||
{% if 'fuse.s3fs' in mount_types %}
|
{% if 'fuse.s3fs' in mount_types %}
|
||||||
{% set _ = packages.extend(systemd_s3_packages) %}
|
{% set _ = packages.extend(systemd_s3_packages) %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if 'glusterfs' in mount_types %}
|
||||||
|
{% set _ = packages.extend(systemd_glusterfs_packages) %}
|
||||||
|
{% endif %}
|
||||||
{{ packages }}
|
{{ packages }}
|
||||||
|
@ -6,3 +6,7 @@ systemd_ceph_packages:
|
|||||||
|
|
||||||
systemd_s3_packages:
|
systemd_s3_packages:
|
||||||
- s3fs-fuse
|
- s3fs-fuse
|
||||||
|
|
||||||
|
systemd_glusterfs_packages:
|
||||||
|
- glusterfs
|
||||||
|
- glusterfs-fuse
|
||||||
|
Loading…
x
Reference in New Issue
Block a user