Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests #4

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:
strategy:
matrix:
distro:
- image: jrei/systemd-ubuntu:16.04
instance: systemd-ubuntu-16.04
# - image: jrei/systemd-ubuntu:16.04
# instance: systemd-ubuntu-16.04
- image: jrei/systemd-ubuntu:18.04
instance: systemd-ubuntu-18.04
- image: jrei/systemd-ubuntu:20.04
instance: systemd-ubuntu-20.04
# - image: jrei/systemd-ubuntu:20.04
# instance: systemd-ubuntu-20.04
# - image: jrei/systemd-centos:7
# instance: systemd-centos-7
# - image: jrei/systemd-centos:8
Expand All @@ -40,7 +40,7 @@ jobs:
uses: actions/[email protected]

- name: Install molecule
run: pip3 install molecule[ansible,ansible-base,docker,lint]
run: pip3 install molecule molecule-docker ansible ansible-lint docker

- name: Run molecule
run: molecule test
Expand Down
2 changes: 2 additions & 0 deletions handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
- name: Get elasticsearch log
command: tail -n 150 /var/log/elasticsearch/{{ elastic_config.cluster.name }}.log
register: _elasticsearch_log
changed_when: false
- name: Print the log
debug:
var: _elasticsearch_log
Expand All @@ -45,6 +46,7 @@
url_username: "{{ _elastic_elastic_user['name'] }}"
url_password: "{{ _elastic_elastic_user['pass'] }}"
validate_certs: false
no_log: "{{ lookup('ansible.builtin.env', 'MOLECULE_FILE') is falsy }}"
listen: elastic-reload-settings
# **Some** settings stored in the keystore are reloadable. This means that ES
# does not have to be restarted. Instead, the above call will make the
Expand Down
11 changes: 4 additions & 7 deletions molecule/default/ansible-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,19 @@ use_default_rules: true

skip_list:
- no-handler
- fqcn-builtins
- yaml # I will manually run yamllint

# Any rule that has the 'opt-in' tag will not be loaded unless its 'id' is
# mentioned in the enable_list:
enable_list:
- no-same-owner
- no-log-password
- empty-string-compare

# Offline mode disables installation of requirements.yml
offline: false

# List of additional kind:pattern to be added at the top of the default
# match list, first match determines the file kind.
kinds:
# - playbook: "**/examples/*.{yml,yaml}"
# - galaxy: "**/folder/galaxy.yml"
# - tasks: "**/tasks/*.yml"
# - vars: "**/vars/*.yml"
# - meta: "**/meta/main.yml"
- yaml: "**/*.yaml-too"
kinds: []
6 changes: 1 addition & 5 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ lint: |
set -e
yamllint --config-file molecule/default/yamllint.yml .
ansible-lint -c molecule/default/ansible-lint.yml .
flake8
platforms:
- name: "${MOLECULE_INSTANCE_NAME:-systemd-ubuntu-18.04}"
image: "${MOLECULE_DISTRO:-jrei/systemd-ubuntu:18.04}"
Expand All @@ -27,7 +26,4 @@ provisioner:
scenario:
name: default
verifier:
name: testinfra
enabled: false
lint:
name: flake8
name: ansible
6 changes: 1 addition & 5 deletions molecule/default/requirements.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---

# - src: reallyenglish.apt-repo
- src: https://github.com/nkakouros/ansible-role-apt-repo
scm: git
version: patch-1
name: reallyenglish.apt-repo
- src: trombik.apt_repo
- src: geerlingguy.java
- src: geerlingguy.git
- src: nkakouros.easyrsa
1 change: 1 addition & 0 deletions tasks/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
failed_when:
- _result is failed
- _result.json.error.reason | d('') is not contains('already exists')
no_log: "{{ lookup('ansible.builtin.env', 'MOLECULE_FILE') is falsy }}"
loop: "{{ elastic_api_requests }}"
loop_control:
loop_var: _elasticsearch__request
1 change: 1 addition & 0 deletions tasks/core/roles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
url_username: "{{ _elastic_elastic_user['name'] }}"
url_password: "{{ _elastic_elastic_user['pass'] }}"
validate_certs: false
no_log: "{{ lookup('ansible.builtin.env', 'MOLECULE_FILE') is falsy }}"
loop: "{{ elastic_custom_roles }}"
loop_control:
loop_var: _elasticsearch__role
3 changes: 3 additions & 0 deletions tasks/indexes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
validate_certs: false
return_content: true
when: _elasticsearch__template.file is defined
no_log: "{{ lookup('ansible.builtin.env', 'MOLECULE_FILE') is falsy }}"
loop: "{{ elastic_index_templates }}"
loop_control:
loop_var: _elasticsearch__template
Expand All @@ -33,6 +34,7 @@
return_content: true
register: _existing_templates
when: _elasticsearch__template.overrides is defined
no_log: "{{ lookup('ansible.builtin.env', 'MOLECULE_FILE') is falsy }}"
loop: "{{ elastic_index_templates }}"
loop_control:
loop_var: _elasticsearch__template
Expand All @@ -52,6 +54,7 @@
validate_certs: false
return_content: false
when: _elasticsearch__template.overrides is defined
no_log: "{{ lookup('ansible.builtin.env', 'MOLECULE_FILE') is falsy }}"
loop: "{{ elastic_index_templates }}"
loop_control:
loop_var: _elasticsearch__template
Expand Down
1 change: 1 addition & 0 deletions tasks/pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
url_password: "{{ _elastic_elastic_user['pass'] }}"
validate_certs: false
return_content: true
no_log: "{{ lookup('ansible.builtin.env', 'MOLECULE_FILE') is falsy }}"
loop: "{{ _elastic_pipelines | d([]) }}"
loop_control:
loop_var: _elasticsearch__pipeline
3 changes: 3 additions & 0 deletions tasks/realms/native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
validate_certs: false
return_content: true
when: _elasticsearch__user.name not in _elastic_builtin_users
no_log: "{{ lookup('ansible.builtin.env', 'MOLECULE_FILE') is falsy }}"
loop: "{{ elastic_users }}"
loop_control:
loop_var: _elasticsearch__user
Expand All @@ -50,6 +51,7 @@
url_password: "{{ _elastic_elastic_user['pass'] }}"
validate_certs: false
return_content: true
no_log: "{{ lookup('ansible.builtin.env', 'MOLECULE_FILE') is falsy }}"
loop: "{{
elastic_users
| rejectattr('name', 'equalto', 'elastic')
Expand All @@ -71,3 +73,4 @@
| list
| first
}}
no_log: "{{ lookup('ansible.builtin.env', 'MOLECULE_FILE') is falsy }}"
4 changes: 4 additions & 0 deletions tasks/snapshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
url_password: "{{ _elastic_elastic_user['pass'] }}"
validate_certs: false
return_content: false
no_log: "{{ lookup('ansible.builtin.env', 'MOLECULE_FILE') is falsy }}"
loop: "{{ elastic_snapshot_repositories }}"
loop_control:
loop_var: _elasticsearch__repo
Expand All @@ -37,6 +38,7 @@
url_password: "{{ _elastic_elastic_user['pass'] }}"
validate_certs: false
return_content: false
no_log: "{{ lookup('ansible.builtin.env', 'MOLECULE_FILE') is falsy }}"
loop: "{{ elastic_snapshot_policies }}"
loop_control:
loop_var: _elasticsearch__policy
Expand All @@ -53,6 +55,7 @@
validate_certs: false
return_content: false
when: elastic_snapshot_policy_enable | bool
no_log: "{{ lookup('ansible.builtin.env', 'MOLECULE_FILE') is falsy }}"

- name: Stop SLM policy
uri:
Expand All @@ -66,3 +69,4 @@
validate_certs: false
return_content: false
when: not elastic_snapshot_policy_enable | bool
no_log: "{{ lookup('ansible.builtin.env', 'MOLECULE_FILE') is falsy }}"
1 change: 1 addition & 0 deletions tasks/stored-scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
url_password: "{{ _elastic_elastic_user['pass'] }}"
validate_certs: false
return_content: false
no_log: "{{ lookup('ansible.builtin.env', 'MOLECULE_FILE') is falsy }}"
loop: "{{ elastic_stored_scripts }}"
loop_control:
loop_var: _elasticsearch__script