Skip to content

Commit

Permalink
Fix lint errors and update molecule for ansible v2.8 (#23)
Browse files Browse the repository at this point in the history
* Fix yamlint warning

* Replace categories by galaxy tags

Fixing: E702: Use 'galaxy_tags' rather than 'categories'
FIxing: E701: Role info should contain description

* Fix shell set pipefail lines

* Fix for molecule inconsistency

ansible/molecule#1727

* Fix molecule version

* Add flake8 installation

* Travis CI moved to python 3.6

Pythton 2.7 will be deprecated at 01.01.2010

* FIx ansible deprecation warning

* fix octal file mode checks (to work in both ansible v2.7.x and v2.8.x)

* update to latest molecule 2.22rc3 (that fixes flake8 and cerberus dependencies)

* update to recent molecule 2.22 stable version
  • Loading branch information
lhoss authored and HorizonNet committed Dec 14, 2019
1 parent 1cd75fc commit 64ec97e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ services:
before_install:
- sudo apt-get -qq update
install:
- pip install molecule
# molecule version >v2.22 required for compatibility with ansible 2.8.x (provided in the used docker image)
- pip install molecule==2.22
- pip install docker
script:
- molecule test
Expand Down
5 changes: 3 additions & 2 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
galaxy_info:
author: "Matthias Baumann & Jan Hentschel"
description: "Role to install kerberos server(s)"
company: Ultra Tendency GmbH
license: BSD 3-Clause
min_ansible_version: 1.4
platforms:
- name: EL
versions:
- 7
categories:
galaxy_tags:
- kerberos
- kdc
dependencies: []
dependencies: [ ]
2 changes: 1 addition & 1 deletion molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ lint:
platforms:
- name: centos-7
image: fiercely/centos7:systemd
privileged: True
privileged: true
volume_mounts:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/usr/sbin/init"
Expand Down
6 changes: 3 additions & 3 deletions molecule/default/tests/test_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_kdc_conf(host):
assert kdc_conf.is_file
assert kdc_conf.user == 'root'
assert kdc_conf.group == 'root'
assert oct(kdc_conf.mode) == '0600'
assert kdc_conf.mode == 0o600


@pytest.mark.parametrize('content', [
Expand All @@ -50,7 +50,7 @@ def test_kadm5_acl(host):
assert kadm5_acl.is_file
assert kadm5_acl.user == 'root'
assert kadm5_acl.group == 'root'
assert oct(kadm5_acl.mode) == '0600'
assert kadm5_acl.mode == 0o600


@pytest.mark.parametrize('content', [
Expand All @@ -70,7 +70,7 @@ def test_krb5_conf(host):
assert krb5_conf.is_file
assert krb5_conf.user == 'root'
assert krb5_conf.group == 'root'
assert oct(krb5_conf.mode) == '0644'
assert krb5_conf.mode == 0o644


@pytest.mark.parametrize('content', [
Expand Down
5 changes: 3 additions & 2 deletions tasks/redhat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@

- name: Install the kerberos packages
yum:
name: "{{ item }}"
name: "{{ kerberos_server_redhat_pkg }}"
state: present
with_items: "{{ kerberos_server_redhat_pkg }}"

- name: Copy the KDC configuration file
template:
Expand All @@ -29,6 +28,7 @@

- name: Create the initial Kerberos database
shell: >
set -o pipefail;
echo -e "{{ kerberos_server_master_db_pass }}\n{{ kerberos_server_master_db_pass }}" | kdb5_util create -s;
touch /var/kerberos/db_created creates=/var/kerberos/db_created
Expand All @@ -41,6 +41,7 @@

- name: Create an admin user for administering the Kerberos database
shell: >
set -o pipefail;
echo -e "{{ kerberos_server_kadmin_pass }}\n{{ kerberos_server_kadmin_pass }}" |
kadmin.local -q "addprinc {{ kerberos_server_kadmin_user }}/admin";
touch /var/kerberos/admin_created creates=/var/kerberos/admin_created
Expand Down

0 comments on commit 64ec97e

Please sign in to comment.