-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
295 additions
and
70 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
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
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,38 @@ | ||
Role Name | ||
========= | ||
|
||
A brief description of the role goes here. | ||
|
||
Requirements | ||
------------ | ||
|
||
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. | ||
|
||
Role Variables | ||
-------------- | ||
|
||
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. | ||
|
||
Dependencies | ||
------------ | ||
|
||
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. | ||
|
||
Example Playbook | ||
---------------- | ||
|
||
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: | ||
|
||
- hosts: servers | ||
roles: | ||
- { role: username.rolename, x: 42 } | ||
|
||
License | ||
------- | ||
|
||
BSD | ||
|
||
Author Information | ||
------------------ | ||
|
||
An optional section for the role authors to include contact information, or a website (HTML is not allowed). |
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,9 @@ | ||
--- | ||
oldp_namespace: "{{ openldap_namespace | default('sterling-openldap', true) }}" | ||
plwa_namespace: "{{ phpldapadmin_namespace | default('sterling-phpldapadmin', true) }}" | ||
|
||
oldp_host: "openldap-svc.{{ oldp_namespace }}.svc.cluster.local" | ||
|
||
ldp_admin_password: "{{ openldap_admin_password | default('passw0rd') }}" | ||
|
||
plwa_image: docker.io/osixia/phpldapadmin:latest |
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,17 @@ | ||
--- | ||
# - name: Check for required environment variables | ||
# ansible.builtin.assert: | ||
# that: | ||
# # NAMESPACE | ||
# - lookup('env', 'OPENLDAP_NAMESPACE') != "" | ||
# fail_msg: "One or more required environment variables are not defined" | ||
|
||
|
||
# 1. Fail if required parameters are not set | ||
# ----------------------------------------------------------------------------- | ||
- name: "Fail if required properties have not been provided" | ||
ansible.builtin.assert: | ||
that: | ||
- oldp_namespace is defined and oldp_namespace != "" | ||
- plwa_namespace is defined and plwa_namespace != "" | ||
fail_msg: "One or more required properties have not been set" |
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,65 @@ | ||
--- | ||
# Create Kubernetes namespace | ||
# ----------------------------------------------------------------------------- | ||
- name: "Create namespace for phpLdapWebAdmin" | ||
kubernetes.core.k8s: | ||
state: present | ||
definition: | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: "{{ plwa_namespace }}" | ||
labels: | ||
name: phpldapadmin | ||
register: cout | ||
|
||
# Create Secrets | ||
# ----------------------------------------------------------------------------- | ||
- name: Create Secrets for phpLdapWebAdmin | ||
kubernetes.core.k8s: | ||
state: present | ||
definition: | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: phpldapadmin-secret | ||
namespace: "{{ plwa_namespace }}" | ||
labels: | ||
app: phpldapadmin | ||
type: Opaque | ||
stringData: | ||
LDAP_ADMIN_PASSWORD: "{{ ldp_admin_password }}" | ||
|
||
# # Create ServiceAccount | ||
# ----------------------------------------------------------------------------- | ||
- name: Create Service Account for phpLdapWebAdmin | ||
kubernetes.core.k8s: | ||
state: present | ||
definition: | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: phpldapadmin-sa | ||
namespace: "{{ plwa_namespace }}" | ||
|
||
# Create Role Binding | ||
# ----------------------------------------------------------------------------- | ||
- name: Create Role Binding for phpLdapWebAdmin | ||
kubernetes.core.k8s: | ||
state: present | ||
definition: | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: 'phpldapadmin-anyuid' | ||
namespace: "{{ plwa_namespace }}" | ||
labels: | ||
app: phpldapadmin | ||
subjects: | ||
- kind: ServiceAccount | ||
name: phpldapadmin-sa | ||
namespace: "{{ plwa_namespace }}" | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: 'system:openshift:scc:anyuid' |
Oops, something went wrong.