added vault nfs mount
This commit is contained in:
10
Jenkinsfile
vendored
10
Jenkinsfile
vendored
@@ -33,10 +33,15 @@ pipeline {
|
||||
description: 'Install Docker and Docker Compose'
|
||||
)
|
||||
booleanParam(
|
||||
name: 'INSTALL_NFS',
|
||||
name: 'INSTALL_NFS_FOLDER',
|
||||
defaultValue: false,
|
||||
description: 'Install NFS and mount NFSFolder'
|
||||
)
|
||||
booleanParam(
|
||||
name: 'INSTALL_NFS_VAULT',
|
||||
defaultValue: false,
|
||||
description: 'Install NFS and mount vault share'
|
||||
)
|
||||
}
|
||||
|
||||
environment {
|
||||
@@ -200,7 +205,8 @@ all:
|
||||
ansible-playbook playbooks/configure.yml \
|
||||
-i temp_inventory.yml \
|
||||
-e "install_docker=${params.INSTALL_DOCKER}" \
|
||||
-e "install_nfs=${params.INSTALL_NFS}"
|
||||
-e "install_nfs_folder=${params.INSTALL_NFS_FOLDER}" \
|
||||
-e "install_nfs_vault=${params.INSTALL_NFS_VAULT}"
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,10 @@
|
||||
- name: Include NFS role
|
||||
ansible.builtin.include_role:
|
||||
name: nfs
|
||||
when: install_nfs | default(false) | bool
|
||||
vars:
|
||||
install_nfs_folder: "{{ install_nfs_folder | default(false) | bool }}"
|
||||
install_nfs_vault: "{{ install_nfs_vault | default(false) | bool }}"
|
||||
when: install_nfs_folder | default(false) | bool or install_nfs_vault | default(false) | bool
|
||||
|
||||
- name: Reboot if required
|
||||
ansible.builtin.reboot:
|
||||
|
||||
@@ -6,23 +6,50 @@
|
||||
state: present
|
||||
update_cache: true
|
||||
|
||||
- name: Create NFS mount directory
|
||||
- name: Create NFSFolder mount directory
|
||||
ansible.builtin.file:
|
||||
path: /var/NFSFolder
|
||||
state: directory
|
||||
mode: '0755'
|
||||
when: install_nfs_folder | default(false) | bool
|
||||
|
||||
- name: Add NFS mount to fstab
|
||||
- name: Add NFSFolder mount to fstab
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/fstab
|
||||
line: "192.168.0.161:/mnt/share1/NFSFolder /var/NFSFolder nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0"
|
||||
state: present
|
||||
create: true
|
||||
when: install_nfs_folder | default(false) | bool
|
||||
|
||||
- name: Mount NFS share
|
||||
- name: Mount NFSFolder share
|
||||
ansible.posix.mount:
|
||||
path: /var/NFSFolder
|
||||
src: "192.168.0.161:/mnt/share1/NFSFolder"
|
||||
fstype: nfs
|
||||
opts: "auto,nofail,noatime,nolock,intr,tcp,actimeo=1800"
|
||||
state: mounted
|
||||
when: install_nfs_folder | default(false) | bool
|
||||
|
||||
- name: Create vault mount directory
|
||||
ansible.builtin.file:
|
||||
path: /var/vault
|
||||
state: directory
|
||||
mode: '0755'
|
||||
when: install_nfs_vault | default(false) | bool
|
||||
|
||||
- name: Add vault mount to fstab
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/fstab
|
||||
line: "192.168.0.188:/mnt/vault /var/vault nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0"
|
||||
state: present
|
||||
create: true
|
||||
when: install_nfs_vault | default(false) | bool
|
||||
|
||||
- name: Mount vault share
|
||||
ansible.posix.mount:
|
||||
path: /var/vault
|
||||
src: "192.168.0.188:/mnt/vault"
|
||||
fstype: nfs
|
||||
opts: "auto,nofail,noatime,nolock,intr,tcp,actimeo=1800"
|
||||
state: mounted
|
||||
when: install_nfs_vault | default(false) | bool
|
||||
|
||||
Reference in New Issue
Block a user