Set nolock for nfs mount for mysql and templating a testing framework

This commit is contained in:
2018-04-23 19:47:55 -04:00
parent c76465f4a6
commit fece272f15
6 changed files with 58 additions and 3 deletions

View File

@@ -67,12 +67,14 @@
get_url:
url: "https://github.com/docker/compose/releases/download/{{docker_compose_version_to_install}}/docker-compose-{{ ansible_system }}-{{ ansible_userspace_architecture }}"
dest: /usr/local/bin/docker-compose
validate_certs: false
mode: 755
group: docker
- name: Set timezone to NewYork
timezone:
name: America/New_York
ignore_errors: true
- name: Replace sudoers file
template: src=../roles/common/templates/sudoers.j2 dest=/etc/sudoers
@@ -107,7 +109,7 @@
lineinfile: dest=/etc/fstab
regexp=\/data
state=present
line="{{ nfs_location }}:/volumeUSB1/usbshare/raw-files/fileserver/shares/lab-data /data nfs defaults 0 0"
line="{{ nfs_location }}:/volumeUSB1/usbshare/raw-files/fileserver/shares/lab-data /data nfs defaults,nolock 0 0"
- name: Mount USB lab data directory
mount:
@@ -115,7 +117,8 @@
src: 10.0.0.150:/volumeUSB1/usbshare/raw-files/fileserver/shares/lab-data
state: mounted
fstype: nfs
ignore_errors: true
- name: test for swap partition
shell: swapon -s | grep -E "^/"
register: swapfile
@@ -136,6 +139,7 @@
- name: prepare swapfile
when: swapfile|failed
shell: mkswap /swapfile
ignore_errors: yes
- name: enable swap
when: swapfile|failed

View File

@@ -110,7 +110,8 @@
src: 10.0.0.150:/volumeUSB1/usbshare/raw-files
state: mounted
fstype: nfs
ignore_errors: true
- name: Install ngrok
npm:
name: ngrok

2
test-inventory Normal file
View File

@@ -0,0 +1,2 @@
[developer-machines]
localhost

View File

@@ -0,0 +1,28 @@
FROM ubuntu:16.04
MAINTAINER Jacob Cody Wimer <jacob.wimer@gmail.com>
RUN apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive \
apt-get install -y -q \
build-essential \
python python-dev python-pip \
libffi-dev libssl-dev \
libxml2-dev libxslt1-dev zlib1g-dev \
git \
openssl \
openssh-server \
ca-certificates \
apt-transport-https \
sudo \
&& pip install --upgrade setuptools pip wheel \
&& pip install --upgrade pyyaml jinja2 pycrypto \
&& pip install --upgrade pywinrm \
&& apt-get -qq clean \
&& rm -rf \
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/*
RUN mkdir /ansible
VOLUME /ansible

6
test/ansible-test Normal file
View File

@@ -0,0 +1,6 @@
#!/bin/bash
pushd /ansible
pip install pipenv
pipenv install
pipenv run ansible-playbook -i test-inventory --connection=local playbooks/site.yml

14
test/run-tests.sh Normal file
View File

@@ -0,0 +1,14 @@
#!/bin/bash
project_dir="$( dirname $(dirname $(readlink -f $0)))"
docker build -t xenial-ansible -f ${project_dir}/test/Dockerfile-ubuntu-xenial ${project_dir}
docker run -it \
-v ${project_dir}:/ansible \
-v /etc/timezone:/etc/timezone:ro \
-v /etc/localtime:/etc/localtime:ro \
--rm --privileged \
xenial-ansible \
/ansible/test/ansible-test