Merge "Convert role to use a common systemd mount role"

This commit is contained in:
Zuul 2018-07-31 15:13:33 +00:00 committed by Gerrit Code Review
commit 5586769730
4 changed files with 30 additions and 32 deletions

View File

@ -13,14 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Start glance mount(s)
systemd:
daemon_reload: yes
name: "{{ item.local_path.lstrip('/') | replace('/', '-') }}.mount"
enabled: "yes"
state: "restarted"
with_items: "{{ glance_nfs_client }}"
- name: Stop services
service:
name: "{{ item.service_name }}"

View File

@ -78,19 +78,33 @@
- Manage LB
- Restart glance services
- name: Glance nfs mount(s)
config_template:
src: "glance-systemd-mount.j2"
dest: "/etc/systemd/system/{{ item.local_path.lstrip('/') | replace('/', '-') }}.mount"
owner: "root"
group: "root"
mode: "0640"
config_overrides: "{{ item.config_overrides | default({}) }}"
config_type: "ini"
when: item.condition | default(True)
- name: Run the systemd mount role
include_role:
name: systemd_mount
private: true
vars:
systemd_mounts:
- config_overrides: "{{ mount_var.config_overrides | default({}) }}"
what: "{{ mount_var.server }}:{{ mount_var.remote_path }}"
where: "{{ mount_var.local_path }}"
type: "{{ mount_var.type }}"
options: "{{ mount_var.options }}"
unit:
After:
- network.target rpcbind.service rpc-statd.service
Conflicts:
- umount.target
Requires:
- rpcbind.service rpc-statd.service
Before:
- glance-api.service
state: 'started'
enabled: true
with_items: "{{ glance_nfs_client }}"
notify:
- Start glance mount(s)
loop_control:
loop_var: mount_var
tags:
- glance-config
- name: Create glance cache management cron jobs
cron:

View File

@ -1,12 +0,0 @@
[Unit]
Description=Glance Images {{ item.local_path }}
After=network.target
[Mount]
What={{ item.server }}:{{ item.remote_path }}
Where={{ item.local_path }}
Type={{ item.type }}
Options={{ item.options | default('_netdev,auto') }}
[Install]
WantedBy=multi-user.target

View File

@ -58,6 +58,10 @@
src: https://git.openstack.org/openstack/ansible-role-systemd_service
scm: git
version: master
- name: systemd_mount
src: https://git.openstack.org/openstack/ansible-role-systemd_mount
scm: git
version: master
- name: python_venv_build
src: https://git.openstack.org/openstack/ansible-role-python_venv_build
scm: git