Convert role to use a common systemd mount role
The systemd unit files are being converted to use common roles to reduce code sprawl throughout the playbooks. This change allows us to use a common systemd_mount role as an include which will give us a consistent experience when deploying services and setting up their resournces on OS's that uses systemd. Closes-Bug: #1774037 Change-Id: I11d083788cd388dab0695878193ab18af1b5038b Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
parent
33b0e35e06
commit
659e3278d0
@ -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 }}"
|
||||
|
@ -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:
|
||||
|
@ -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
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user