Set nolock for nfs mount for mysql and templating a testing framework
This commit is contained in:
@@ -67,12 +67,14 @@
|
|||||||
get_url:
|
get_url:
|
||||||
url: "https://github.com/docker/compose/releases/download/{{docker_compose_version_to_install}}/docker-compose-{{ ansible_system }}-{{ ansible_userspace_architecture }}"
|
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
|
dest: /usr/local/bin/docker-compose
|
||||||
|
validate_certs: false
|
||||||
mode: 755
|
mode: 755
|
||||||
group: docker
|
group: docker
|
||||||
|
|
||||||
- name: Set timezone to NewYork
|
- name: Set timezone to NewYork
|
||||||
timezone:
|
timezone:
|
||||||
name: America/New_York
|
name: America/New_York
|
||||||
|
ignore_errors: true
|
||||||
|
|
||||||
- name: Replace sudoers file
|
- name: Replace sudoers file
|
||||||
template: src=../roles/common/templates/sudoers.j2 dest=/etc/sudoers
|
template: src=../roles/common/templates/sudoers.j2 dest=/etc/sudoers
|
||||||
@@ -107,7 +109,7 @@
|
|||||||
lineinfile: dest=/etc/fstab
|
lineinfile: dest=/etc/fstab
|
||||||
regexp=\/data
|
regexp=\/data
|
||||||
state=present
|
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
|
- name: Mount USB lab data directory
|
||||||
mount:
|
mount:
|
||||||
@@ -115,7 +117,8 @@
|
|||||||
src: 10.0.0.150:/volumeUSB1/usbshare/raw-files/fileserver/shares/lab-data
|
src: 10.0.0.150:/volumeUSB1/usbshare/raw-files/fileserver/shares/lab-data
|
||||||
state: mounted
|
state: mounted
|
||||||
fstype: nfs
|
fstype: nfs
|
||||||
|
ignore_errors: true
|
||||||
|
|
||||||
- name: test for swap partition
|
- name: test for swap partition
|
||||||
shell: swapon -s | grep -E "^/"
|
shell: swapon -s | grep -E "^/"
|
||||||
register: swapfile
|
register: swapfile
|
||||||
@@ -136,6 +139,7 @@
|
|||||||
- name: prepare swapfile
|
- name: prepare swapfile
|
||||||
when: swapfile|failed
|
when: swapfile|failed
|
||||||
shell: mkswap /swapfile
|
shell: mkswap /swapfile
|
||||||
|
ignore_errors: yes
|
||||||
|
|
||||||
- name: enable swap
|
- name: enable swap
|
||||||
when: swapfile|failed
|
when: swapfile|failed
|
||||||
|
|||||||
@@ -110,7 +110,8 @@
|
|||||||
src: 10.0.0.150:/volumeUSB1/usbshare/raw-files
|
src: 10.0.0.150:/volumeUSB1/usbshare/raw-files
|
||||||
state: mounted
|
state: mounted
|
||||||
fstype: nfs
|
fstype: nfs
|
||||||
|
ignore_errors: true
|
||||||
|
|
||||||
- name: Install ngrok
|
- name: Install ngrok
|
||||||
npm:
|
npm:
|
||||||
name: ngrok
|
name: ngrok
|
||||||
|
|||||||
2
test-inventory
Normal file
2
test-inventory
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
[developer-machines]
|
||||||
|
localhost
|
||||||
28
test/Dockerfile-ubuntu-xenial
Normal file
28
test/Dockerfile-ubuntu-xenial
Normal 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
6
test/ansible-test
Normal 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
14
test/run-tests.sh
Normal 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
|
||||||
|
|
||||||
Reference in New Issue
Block a user