-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #165 from IQSS/164_localstack
basic localstack framework
- Loading branch information
Showing
6 changed files
with
112 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
|
||
- name: we need yum-utils | ||
yum: | ||
name: yum-utils | ||
state: latest | ||
|
||
- name: to install the docker-ce repo | ||
shell: 'yum-config-manager --add-repo {{ localstack.docker.repo }}' | ||
|
||
- name: install docker-ce | ||
yum: | ||
name: ['docker-ce','docker-ce-cli','containerd.io','docker-compose','python-docker-py'] | ||
|
||
- name: ensure /etc/docker exists | ||
file: | ||
path: /etc/docker | ||
state: directory | ||
owner: root | ||
group: root | ||
mode: 0755 | ||
|
||
- name: configure cidr range | ||
template: | ||
src: daemon.json.j2 | ||
dest: /etc/docker/daemon.json | ||
owner: root | ||
group: root | ||
mode: 0644 | ||
when: localstack.docker.cidr is undefined | ||
|
||
- name: add ansible_user to docker group | ||
user: | ||
name: '{{ ansible_user }}' | ||
groups: docker | ||
append: yes | ||
|
||
- name: reload systemd, enable docker, start | ||
systemd: | ||
name: docker | ||
enabled: yes | ||
daemon_reload: yes | ||
state: started | ||
|
||
# so we can run localstack task stand-alone | ||
- include: dataverse-fqdn.yml | ||
|
||
- name: is hostname_external set | ||
set_fact: | ||
hostname_external: '{{ public_hostname }}' | ||
when: localstack.hostname_external is undefined | ||
|
||
- name: place docker-compose.yml template | ||
template: | ||
src: localstack-compose.yml.j2 | ||
dest: '{{ ansible_env.HOME }}/localstack-compose.yml' | ||
|
||
- name: start s3-test container | ||
shell: 'docker-compose -f localstack-compose.yml up -d' | ||
args: | ||
chdir: '{{ ansible_env.HOME }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"bip" : "{{ localstack.docker.cidr }}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
version: '2.1' | ||
|
||
services: | ||
localstack: | ||
container_name: "{{ localstack.container }}" | ||
image: localstack/localstack | ||
ports: | ||
- "4567-4599:4567-4599" | ||
- "{{ localstack.web_ui }}-{{ localstack.web_ui }}:{{ localstack.web_ui }}-{{ localstack.web_ui }}" | ||
environment: | ||
- SERVICES=s3 | ||
- DEBUG={{ localstack.debug }} | ||
- DATA_DIR={{ localstack.data_dir }} | ||
- PORT_WEB_UI={{ localstack.web_ui }} | ||
- LOCALSTACK_HOSTNAME={{ localstack.hostname_external }} | ||
- LAMBDA_EXECUTOR=local | ||
- DOCKER_HOST=unix:///var/run/docker.sock | ||
volumes: | ||
- "/tmp/localstack}:/tmp/localstack" | ||
- "/var/run/docker.sock:/var/run/docker.sock" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters