Skip to content

Commit

Permalink
initial import
Browse files Browse the repository at this point in the history
  • Loading branch information
trombik committed Oct 8, 2019
1 parent 6523430 commit 356438c
Show file tree
Hide file tree
Showing 27 changed files with 809 additions and 72 deletions.
4 changes: 3 additions & 1 deletion .kitchen.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
driver:
name: vagrant
customize:
memory: 2048

transport:
name: rsync
Expand All @@ -13,7 +15,7 @@ provisioner:
ansible_verbosity: 1
ansible_verbose: true
ansible_extra_flags: <%= ENV['ANSIBLE_EXTRA_FLAGS'] %>
# requirements_path: requirements.yml
requirements_path: requirements.yml
http_proxy: <%= ENV['ANSIBLE_PROXY'] %>
idempotency_test: true
additional_copy_path:
Expand Down
228 changes: 228 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
GIT
remote: https://github.com/trombik/infrataster.git
revision: 1cc9b77126d5e1e7a445456cdbf6fee4f0ab4bd4
branch: reallyenglish
specs:
infrataster (0.3.2)
capybara
faraday
faraday_middleware (>= 0.10.0)
net-ssh
net-ssh-gateway
poltergeist
rspec (>= 2.0, < 4.0)
thor

GIT
remote: https://github.com/trombik/kitchen-sync.git
revision: d1d14052e3f401d87986eaffdf5d117518c8bd68
branch: without_full_path_to_rsync
specs:
kitchen-sync (2.1.2.pre)
net-sftp
test-kitchen (>= 1.0.0)

GEM
remote: https://rubygems.org/
specs:
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
ast (2.4.0)
builder (3.2.3)
capybara (3.29.0)
addressable
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (~> 1.5)
xpath (~> 3.2)
cliver (0.3.2)
diff-lcs (1.3)
equatable (0.6.1)
erubis (2.7.0)
faraday (0.16.2)
multipart-post (>= 1.2, < 3)
faraday_middleware (0.13.1)
faraday (>= 0.7.4, < 1.0)
ffi (1.11.1)
gssapi (1.3.0)
ffi (>= 1.0.1)
gyoku (1.3.1)
builder (>= 2.1.2)
httpclient (2.8.3)
kitchen-ansible (0.50.1)
net-ssh (>= 3)
test-kitchen (>= 1.4)
kitchen-vagrant (1.6.0)
test-kitchen (>= 1.4, < 3)
kitchen-verifier-serverspec (0.7.0)
net-ssh (>= 3)
test-kitchen (>= 1.4)
kitchen-verifier-shell (0.2.0)
test-kitchen (~> 1.4)
license-acceptance (1.0.13)
pastel (~> 0.7)
tomlrb (~> 1.2)
tty-box (~> 0.3)
tty-prompt (~> 0.18)
little-plugger (1.1.4)
logging (2.2.2)
little-plugger (~> 1.1)
multi_json (~> 1.10)
mini_mime (1.0.2)
mini_portile2 (2.4.0)
mixlib-install (3.11.21)
mixlib-shellout
mixlib-versioning
thor
mixlib-shellout (2.4.4)
mixlib-versioning (1.2.7)
multi_json (1.13.1)
multipart-post (2.1.1)
necromancer (0.5.0)
net-scp (2.0.0)
net-ssh (>= 2.6.5, < 6.0.0)
net-sftp (2.1.2)
net-ssh (>= 2.6.5)
net-ssh (4.2.0)
net-ssh-gateway (2.0.0)
net-ssh (>= 4.0.0)
net-telnet (0.1.1)
nokogiri (1.10.4)
mini_portile2 (~> 2.4.0)
nori (2.6.0)
parallel (1.18.0)
parser (2.6.5.0)
ast (~> 2.4.0)
pastel (0.7.3)
equatable (~> 0.6)
tty-color (~> 0.5)
poltergeist (1.18.1)
capybara (>= 2.1, < 4)
cliver (~> 0.3.1)
websocket-driver (>= 0.2.0)
powerpack (0.1.2)
public_suffix (4.0.1)
rack (2.0.7)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rainbow (2.2.2)
rake
rake (13.0.0)
regexp_parser (1.6.0)
rspec (3.8.0)
rspec-core (~> 3.8.0)
rspec-expectations (~> 3.8.0)
rspec-mocks (~> 3.8.0)
rspec-core (3.8.2)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-its (1.3.0)
rspec-core (>= 3.0.0)
rspec-expectations (>= 3.0.0)
rspec-mocks (3.8.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-support (3.8.3)
rubocop (0.51.0)
parallel (~> 1.10)
parser (>= 2.3.3.1, < 3.0)
powerpack (~> 0.1)
rainbow (>= 2.2.2, < 3.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.10.1)
rubyntlm (0.6.2)
rubyzip (1.3.0)
serverspec (2.41.5)
multi_json
rspec (~> 3.0)
rspec-its
specinfra (~> 2.72)
sfl (2.3)
specinfra (2.82.2)
net-scp
net-ssh (>= 2.7)
net-telnet (= 0.1.1)
sfl
strings (0.1.6)
strings-ansi (~> 0.1)
unicode-display_width (~> 1.5)
unicode_utils (~> 1.4)
strings-ansi (0.1.0)
test-kitchen (1.25.0)
license-acceptance (~> 1.0, >= 1.0.11)
mixlib-install (~> 3.6)
mixlib-shellout (>= 1.2, < 3.0)
net-scp (>= 1.1, < 3.0)
net-ssh (>= 2.9, < 5.0)
net-ssh-gateway (>= 1.2, < 3.0)
thor (~> 0.19)
winrm (~> 2.0)
winrm-elevated (~> 1.0)
winrm-fs (~> 1.1)
thor (0.20.3)
tomlrb (1.2.8)
tty-box (0.4.1)
pastel (~> 0.7.2)
strings (~> 0.1.6)
tty-cursor (~> 0.7)
tty-color (0.5.0)
tty-cursor (0.7.0)
tty-prompt (0.19.0)
necromancer (~> 0.5.0)
pastel (~> 0.7.0)
tty-reader (~> 0.6.0)
tty-reader (0.6.0)
tty-cursor (~> 0.7)
tty-screen (~> 0.7)
wisper (~> 2.0.0)
tty-screen (0.7.0)
unicode-display_width (1.6.0)
unicode_utils (1.4.0)
websocket-driver (0.7.1)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.4)
winrm (2.3.2)
builder (>= 2.1.2)
erubis (~> 2.7)
gssapi (~> 1.2)
gyoku (~> 1.0)
httpclient (~> 2.2, >= 2.2.0.2)
logging (>= 1.6.1, < 3.0)
nori (~> 2.0)
rubyntlm (~> 0.6.0, >= 0.6.1)
winrm-elevated (1.1.1)
winrm (~> 2.0)
winrm-fs (~> 1.0)
winrm-fs (1.3.2)
erubis (~> 2.7)
logging (>= 1.6.1, < 3.0)
rubyzip (~> 1.1)
winrm (~> 2.0)
wisper (2.0.0)
xpath (3.2.0)
nokogiri (~> 1.8)

PLATFORMS
ruby

DEPENDENCIES
infrataster (~> 0.3.2)!
kitchen-ansible
kitchen-sync (~> 2.1.1)!
kitchen-vagrant
kitchen-verifier-serverspec
kitchen-verifier-shell
rake
rspec
rubocop (~> 0.51.0)
serverspec
specinfra
test-kitchen

BUNDLED WITH
2.0.2
39 changes: 37 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,44 @@ None

# Role Variables

| variable | description | default |
| Variable | Description | Default |
|----------|-------------|---------|

| `opendistroforelasticsearch_user` | | `{{ __opendistroforelasticsearch_user }}` |
| `opendistroforelasticsearch_group` | | `{{ __opendistroforelasticsearch_group }}` |
| `opendistroforelasticsearch_log_dir` | | `{{ __opendistroforelasticsearch_log_dir }}` |
| `opendistroforelasticsearch_db_dir` | | `{{ __opendistroforelasticsearch_db_dir }}` |
| `opendistroforelasticsearch_scripts_dir` | | `{{ __opendistroforelasticsearch_scripts_dir }}` |
| `opendistroforelasticsearch_plugins_dir` | | `{{ __opendistroforelasticsearch_plugins_dir }}` |
| `opendistroforelasticsearch_plugin_command` | | `{{ __opendistroforelasticsearch_plugin_command }}` |
| `opendistroforelasticsearch_plugins` | | `[]` |
| `opendistroforelasticsearch_service` | | `{{ __opendistroforelasticsearch_service }}` |
| `opendistroforelasticsearch_package` | | `{{ __opendistroforelasticsearch_package }}` |
| `opendistroforelasticsearch_conf_dir` | | `{{ __opendistroforelasticsearch_conf_dir }}` |
| `opendistroforelasticsearch_jvm_options` | | `""` |
| `opendistroforelasticsearch_conf_file` | | `{{ opendistroforelasticsearch_conf_dir }}/elasticsearch.yml` |
| `opendistroforelasticsearch_flags` | | `""` |
| `opendistroforelasticsearch_config` | | `""` |
| `opendistroforelasticsearch_http_port` | | `9200` |
| `opendistroforelasticsearch_java_home` | | `{{ __opendistroforelasticsearch_java_home }}` |
| `opendistroforelasticsearch_extra_files` | | `[]` |


## FreeBSD

| Variable | Default |
|----------|---------|
| `__opendistroforelasticsearch_user` | `elasticsearch` |
| `__opendistroforelasticsearch_group` | `elasticsearch` |
| `__opendistroforelasticsearch_log_dir` | `/var/log/elasticsearch` |
| `__opendistroforelasticsearch_db_dir` | `/var/db/elasticsearch` |
| `__opendistroforelasticsearch_package` | `textproc/opendistroforelasticsearch` |
| `__opendistroforelasticsearch_conf_dir` | `/usr/local/etc/elasticsearch` |
| `__opendistroforelasticsearch_scripts_dir` | `""` |
| `__opendistroforelasticsearch_plugins_dir` | `/usr/local/lib/elasticsearch/plugins` |
| `__opendistroforelasticsearch_plugin_command` | `/usr/local/lib/elasticsearch/bin/elasticsearch-plugin` |
| `__opendistroforelasticsearch_service` | `elasticsearch` |
| `__opendistroforelasticsearch_jvm_options_dir` | `/usr/local/etc` |
| `__opendistroforelasticsearch_java_home` | `/usr/local` |

# Dependencies

Expand Down
2 changes: 2 additions & 0 deletions ansible.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[defaults]
stdout_callback = yaml
20 changes: 15 additions & 5 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
---
opendistroforelasticsearch_user: opendistroforelasticsearch
opendistroforelasticsearch_group: opendistroforelasticsearch
opendistroforelasticsearch_log_dir: /var/log/opendistroforelasticsearch
opendistroforelasticsearch_user: "{{ __opendistroforelasticsearch_user }}"
opendistroforelasticsearch_group: "{{ __opendistroforelasticsearch_group }}"
opendistroforelasticsearch_log_dir: "{{ __opendistroforelasticsearch_log_dir }}"
opendistroforelasticsearch_db_dir: "{{ __opendistroforelasticsearch_db_dir }}"
opendistroforelasticsearch_service: opendistroforelasticsearch
opendistroforelasticsearch_scripts_dir: "{{ __opendistroforelasticsearch_scripts_dir }}"
opendistroforelasticsearch_plugins_dir: "{{ __opendistroforelasticsearch_plugins_dir }}"
opendistroforelasticsearch_plugin_command: "{{ __opendistroforelasticsearch_plugin_command }}"
opendistroforelasticsearch_plugins: []
opendistroforelasticsearch_service: "{{ __opendistroforelasticsearch_service }}"
opendistroforelasticsearch_package: "{{ __opendistroforelasticsearch_package }}"
opendistroforelasticsearch_conf_dir: "{{ __opendistroforelasticsearch_conf_dir }}"
opendistroforelasticsearch_conf_file: "{{ __opendistroforelasticsearch_conf_dir }}/opendistroforelasticsearch.conf"
opendistroforelasticsearch_jvm_options: ""
opendistroforelasticsearch_conf_file: "{{ opendistroforelasticsearch_conf_dir }}/elasticsearch.yml"
opendistroforelasticsearch_flags: ""
opendistroforelasticsearch_config: ""
opendistroforelasticsearch_http_port: 9200
opendistroforelasticsearch_java_home: "{{ __opendistroforelasticsearch_java_home }}"
opendistroforelasticsearch_extra_files: []
8 changes: 7 additions & 1 deletion handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,11 @@

- name: Restart opendistroforelasticsearch
service:
name: opendistroforelasticsearch
name: "{{ opendistroforelasticsearch_service }}"
state: restarted
notify: Wait for elasticsearch to start in handler

- name: Wait for elasticsearch to start in handler
wait_for:
host: localhost
port: "{{ opendistroforelasticsearch_http_port }}"
4 changes: 2 additions & 2 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
galaxy_info:
role_name: opendistroforelasticsearch
author: Tomoyuki Sakurai
description: Configures something
description: Configures opendistroforelasticsearch
company: N/A
license: BSD
min_ansible_version: 2.0
Expand All @@ -11,4 +11,4 @@ galaxy_info:
versions:
- 12.0
galaxy_tags:
- system
- elasticsearch
4 changes: 4 additions & 0 deletions requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
- name: trombik.sysctl
- name: trombik.java
- name: trombik.freebsd_pkg_repo
8 changes: 8 additions & 0 deletions tasks/configure-jvm-Debian.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---

- name: Add ES_JAVA_OPTS to /etc/default/elasticsearch
lineinfile:
dest: /etc/default/elasticsearch
regexp: '^#?ES_JAVA_OPTS='
line: 'ES_JAVA_OPTS="{{ elasticsearch_jvm_options | join(" ") }}"'
notify: Restart elasticsearch
23 changes: 23 additions & 0 deletions tasks/configure-jvm-FreeBSD.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---

- name: Create /etc/rc.conf.d if it does not exist
file:
path: /etc/rc.conf.d
mode: 0755
state: directory

- name: Create rc.subr flagment
template:
src: FreeBSD.rc.j2
dest: /etc/rc.conf.d/opendistroforelasticsearch
mode: 0644
validate: sh -n %s
notify:
- Restart opendistroforelasticsearch

- name: Create jvm.options
template:
src: jvm.options.j2
dest: "{{ opendistroforelasticsearch_conf_dir }}/jvm.options"
notify:
- Restart opendistroforelasticsearch
Loading

0 comments on commit 356438c

Please sign in to comment.