Commit 6ebd1140 authored by Oyvind.Gjesdal's avatar Oyvind.Gjesdal
Browse files

Merge branch '4-mount-nettverkstasjon' into 'master'

Resolve "mount nettverkstasjon"

Closes #4

See merge request uib-ub/roller-ansible/centos8!1
parents 5391019f 243561a1
Pipeline #79573 passed with stage
in 2 minutes
......@@ -11,10 +11,13 @@ cron_email: false
cron_users:
- root
- "{{ worker_name | default(omit) }}"
nfs_share_mounts: []
nfs_mount_opts: "defaults,noatime,sec=sys"
nrec_instance: true
centos8_dependencies: ["cronie"]
cron_mailto:
- "oyvind.gjesdal@uib.no"
nfs_version: "4"
ssh_public_keys: []
# - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDdUEJYDOo0cVVs9RPBDr/CFJBCvfVaJw0OX97k92MtYHfMPmIxLwAg5O/Vo4YJiPO8EuHB9sr4YpHEpMq1MnXeJE+kldNk5jz2cabmYNEqVJvlI58qkCGlCcUkGmH5HUIvqUsCV5fQ9Ns5vtAVjmDxRIj6oBFSfZZsazRJN4ZNbSe5TJ4RVI259yz6Vwu+HOBJln4YU14RPPwyKsOq58P/VALZJQ4ptz5PRrXcBwooXEEcIrXKZhgrnxEIaBYidO8jLg2lgRjiAw0pfm7WlMOuH51y4bhioRy5Pe7hA1qkKW04SAPFsOOaTotPSRXYRwYfJpbTwOln4hvF4gHOW1D3"
# - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCutmMDmG4GPzOBbVLe2X8u09TgjYk1udCPZ5TF76fskpwrpRMUmWwcurwCpUgt2bwbDYI/7WioO06rz6xZBkl+4J13ntDxI07nLtiXeGpxzGtoMHsJUB07CluYaCWNvXgrH0Mb1swdqH35pKuwsY+9pmQ84ohe9uZCqqmSJG59yPoBFvU9p7D3ggl+1I4JZhXsK/hnqAY524YvceYIhZPJ7Vg2vEz/o6PpZJtI+5lqWyU97vzoTYyoFiq+C0pCMiWfbU0u8a1ti+Js28AUmT0OOU85EajWqVwOIse69bI2ZdY+AqLTtydYn8b0Js43/k2bJk5dLkbd+U6BMUsiEQNx"
......
......@@ -10,12 +10,11 @@
loop: "{{ keep_files.results }}"
when: "item.files | count == 0"
- name: "shell"
shell: "ls /root/{{ item.item.mount_point }}"
loop: "{{ keep_files.results }}"
when: "item.files | count == 0"
- name: "remount"
mount:
state: "mounted"
......@@ -25,7 +24,6 @@
loop: "{{ keep_files.results }}"
when: "item.files | count == 0"
- name: "move files to mount"
shell: "rsync -a /root/{{ item.item.mount_point }}/ {{ item.item.mount_point }}"
loop: "{{ keep_files.results }}"
......
......@@ -47,8 +47,8 @@
# from https://github.com/robertdebock/ansible-role-powertools/blob/master/tasks/main.yml
- name: enable powertools
ini_file:
path: /etc/yum.repos.d/CentOS-PowerTools.repo
section: PowerTools
path: /etc/yum.repos.d/CentOS-Linux-PowerTools.repo
section: powertools
option: enabled
value: "1"
mode: "0644"
......@@ -104,8 +104,14 @@
become: true
when: "hostname is defined and nrec_instance | bool"
- name: "import task nfs"
import_tasks: "nfs.yml"
become: true
when: "nfs_share_mounts | count > 0"
- name: "install extra packages {{ centos7_extra_packages | default ([]) }} if defined"
yum:
name: "{{ centos7_extra_packages }}"
become: true
when: "centos7_extra_packages is defined"
- name: "Install NFS mount utility"
yum:
name: "nfs-utils"
state: "present"
become: true
- name: Mount NFS share_mounts
mount:
fstype: nfs
name: "{{ item.path }}"
opts: "vers={{ nfs_version }},{{ item.opts | default(nfs_mount_opts) }}"
src: "{{ item.location }}"
dump: "{{ item.dump | default(omit) }}"
passno: "{{ item.passno | default(omit) }}"
state: "{{ item.state | default( 'mounted' ) }}"
with_items: "{{ nfs_share_mounts }}"
loop: "{{ nfs_share_mounts }}"
become: true
......@@ -30,7 +30,7 @@
size: "100%FREE"
shrink: "no"
with_items: "{{ volumes_add }}"
- name: "Creating new filesystems on new volumes"
filesystem:
fstype: "{{ item.fs_type }}"
......@@ -52,10 +52,10 @@
state: "mounted"
opts: "{{ item.opts | default('defaults') }}"
with_items: "{{ volumes_add }}"
- name: "check if new file system has content"
find:
paths: "{{ item.mount_point }}"
find:
paths: "{{ item.mount_point }}"
recurse: yes
loop: "{{ volumes_add }}"
when: "item.keep_files | bool"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment