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'
|
description: 'Install Docker and Docker Compose'
|
||||||
)
|
)
|
||||||
booleanParam(
|
booleanParam(
|
||||||
name: 'INSTALL_NFS',
|
name: 'INSTALL_NFS_FOLDER',
|
||||||
defaultValue: false,
|
defaultValue: false,
|
||||||
description: 'Install NFS and mount NFSFolder'
|
description: 'Install NFS and mount NFSFolder'
|
||||||
)
|
)
|
||||||
|
booleanParam(
|
||||||
|
name: 'INSTALL_NFS_VAULT',
|
||||||
|
defaultValue: false,
|
||||||
|
description: 'Install NFS and mount vault share'
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
environment {
|
environment {
|
||||||
@@ -200,7 +205,8 @@ all:
|
|||||||
ansible-playbook playbooks/configure.yml \
|
ansible-playbook playbooks/configure.yml \
|
||||||
-i temp_inventory.yml \
|
-i temp_inventory.yml \
|
||||||
-e "install_docker=${params.INSTALL_DOCKER}" \
|
-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
|
- name: Include NFS role
|
||||||
ansible.builtin.include_role:
|
ansible.builtin.include_role:
|
||||||
name: nfs
|
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
|
- name: Reboot if required
|
||||||
ansible.builtin.reboot:
|
ansible.builtin.reboot:
|
||||||
|
|||||||
@@ -6,23 +6,50 @@
|
|||||||
state: present
|
state: present
|
||||||
update_cache: true
|
update_cache: true
|
||||||
|
|
||||||
- name: Create NFS mount directory
|
- name: Create NFSFolder mount directory
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: /var/NFSFolder
|
path: /var/NFSFolder
|
||||||
state: directory
|
state: directory
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
|
when: install_nfs_folder | default(false) | bool
|
||||||
|
|
||||||
- name: Add NFS mount to fstab
|
- name: Add NFSFolder mount to fstab
|
||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: /etc/fstab
|
path: /etc/fstab
|
||||||
line: "192.168.0.161:/mnt/share1/NFSFolder /var/NFSFolder nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0"
|
line: "192.168.0.161:/mnt/share1/NFSFolder /var/NFSFolder nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0"
|
||||||
state: present
|
state: present
|
||||||
create: true
|
create: true
|
||||||
|
when: install_nfs_folder | default(false) | bool
|
||||||
|
|
||||||
- name: Mount NFS share
|
- name: Mount NFSFolder share
|
||||||
ansible.posix.mount:
|
ansible.posix.mount:
|
||||||
path: /var/NFSFolder
|
path: /var/NFSFolder
|
||||||
src: "192.168.0.161:/mnt/share1/NFSFolder"
|
src: "192.168.0.161:/mnt/share1/NFSFolder"
|
||||||
fstype: nfs
|
fstype: nfs
|
||||||
opts: "auto,nofail,noatime,nolock,intr,tcp,actimeo=1800"
|
opts: "auto,nofail,noatime,nolock,intr,tcp,actimeo=1800"
|
||||||
state: mounted
|
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