-
Notifications
You must be signed in to change notification settings - Fork 145
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 #406 from sean-m-sullivan/option_update
update options on multiple roles
- Loading branch information
Showing
37 changed files
with
459 additions
and
737 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 @@ | ||
--- | ||
apiVersion: awx.ansible.com/v1beta1 | ||
kind: AWX | ||
metadata: | ||
name: awx | ||
spec: | ||
service_type: nodeport | ||
nodeport_port: 30080 | ||
... |
This file was deleted.
Oops, something went wrong.
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,15 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
# Find the latest tag here: https://github.com/ansible/awx-operator/releases | ||
- github.com/ansible/awx-operator/config/default?ref=1.0.0 | ||
- awx.yaml | ||
|
||
# Set the image tags to match the git version from above | ||
images: | ||
- name: quay.io/ansible/awx-operator | ||
newTag: 1.0.0 | ||
|
||
# Specify a custom namespace in which to install AWX | ||
namespace: default | ||
... |
This file was deleted.
Oops, something went wrong.
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,14 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
# Find the latest tag here: https://github.com/ansible/awx-operator/releases | ||
- github.com/ansible/awx-operator/config/default?ref=1.0.0 | ||
|
||
# Set the image tags to match the git version from above | ||
images: | ||
- name: quay.io/ansible/awx-operator | ||
newTag: 1.0.0 | ||
|
||
# Specify a custom namespace in which to install AWX | ||
namespace: default | ||
... |
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 |
---|---|---|
|
@@ -8,18 +8,12 @@ jobs: | |
name: Deploy Tower to Minikube and run tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout awx operator | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: ansible/awx-operator | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
path: controller_configuration | ||
|
||
- name: "Install dependencies" | ||
run: pip install -r controller_configuration/.github/requirements.txt | ||
run: pip install -r .github/requirements.txt | ||
|
||
- name: Setup Minikube | ||
uses: manusa/[email protected] | ||
|
@@ -35,17 +29,27 @@ jobs: | |
|
||
- name: Setup awx operator | ||
run: | | ||
minikube kubectl get deployments | ||
minikube kubectl create secret generic awx-admin-password -- --from-literal=password=password | ||
minikube addons enable ingress | ||
alias kubectl="minikube kubectl --" | ||
make deploy NAMESPACE=default | ||
kubectl apply -f controller_configuration/.github/workflow-config/kube/awx_def.yml | ||
- name: kustomize awx operator | ||
working-directory: .github/workflow-config | ||
run: kustomize build . | kubectl apply -f - | ||
|
||
- name: Wait / Sleep | ||
uses: jakejarvis/[email protected] | ||
with: | ||
time: '180s' | ||
time: '30s' | ||
|
||
- name: kustomize awx | ||
working-directory: .github/workflow-config/kube | ||
run: kustomize build . | kubectl apply -f - | ||
|
||
- name: Wait / Sleep | ||
uses: jakejarvis/[email protected] | ||
with: | ||
time: '30s' | ||
|
||
- name: Check service URL | ||
uses: nick-invision/retry@v2 | ||
|
@@ -68,15 +72,9 @@ jobs: | |
- name: Display Versions | ||
run: which python && pip --version && ansible --version | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: "Install Galaxy dependencies" | ||
run: ansible-galaxy collection install -r .github/collections/requirements.yml | ||
|
||
- name: Check service password | ||
run: echo "Service password is ${{ steps.service-password.outputs.SERVICEPASSWORD }}" | ||
|
||
- name: "Perform playbook tests" | ||
run: ansible-playbook examples/configure_controller.yml -e controller_hostname=${{ steps.service-url.outputs.SERVICEURL }} | ||
|
||
|
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,7 @@ | ||
--- | ||
minor_changes: | ||
- Update options on inventories, job templates, liscence, projects, schedules, and workflow_job_templates roles to match latest awx.awx release | ||
|
||
major_changes: | ||
- Added instance role to add instances using the new awx.awx.instance module. | ||
... |
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,5 @@ | ||
--- | ||
controller_instances: | ||
- hostname: my-instance.prod.example.com | ||
capacity_adjustment: 0.4 | ||
... |
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
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,110 @@ | ||
# controller_configuration.instances | ||
|
||
## Description | ||
|
||
An Ansible Role to create instances on Ansible Controller. | ||
|
||
## Requirements | ||
|
||
ansible-galaxy collection install -r tests/collections/requirements.yml to be installed | ||
Currently: | ||
awx.awx | ||
or | ||
ansible.controller | ||
|
||
## Variables | ||
|
||
### Authentication | ||
|
||
|Variable Name|Default Value|Required|Description|Example| | ||
|:---|:---:|:---:|:---|:---| | ||
|`controller_state`|"present"|no|The state all objects will take unless overridden by object default|'absent'| | ||
|`controller_hostname`|""|yes|URL to the Ansible Controller Server.|127.0.0.1| | ||
|`controller_validate_certs`|`True`|no|Whether or not to validate the Ansible Controller Server's SSL certificate.|| | ||
|`controller_username`|""|no|Admin User on the Ansible Controller Server. Either username / password or oauthtoken need to be specified.|| | ||
|`controller_password`|""|no|Controller Admin User's password on the Ansible Controller Server. This should be stored in an Ansible Vault at vars/controller-secrets.yml or elsewhere and called from a parent playbook. Either username / password or oauthtoken need to be specified.|| | ||
|`controller_oauthtoken`|""|no|Controller Admin User's token on the Ansible Controller Server. This should be stored in an Ansible Vault at or elsewhere and called from a parent playbook. Either username / password or oauthtoken need to be specified.||| | ||
|`controller_instances`|`see below`|yes|Data structure describing your instances Described below.|| | ||
|
||
### Secure Logging Variables | ||
|
||
The following Variables compliment each other. | ||
If Both variables are not set, secure logging defaults to false. | ||
The role defaults to False as normally the add instances task does not include sensitive information. | ||
controller_configuration_instances_secure_logging defaults to the value of controller_configuration_secure_logging if it is not explicitly called. This allows for secure logging to be toggled for the entire suite of controller configuration roles with a single variable, or for the user to selectively use it. | ||
|
||
|Variable Name|Default Value|Required|Description| | ||
|:---:|:---:|:---:|:---:| | ||
|`controller_configuration_instances_secure_logging`|`False`|no|Whether or not to include the sensitive instance groups role tasks in the log. Set this value to `True` if you will be providing your sensitive values from elsewhere.| | ||
|`controller_configuration_secure_logging`|`False`|no|This variable enables secure logging as well, but is shared across multiple roles, see above.| | ||
|
||
### Asynchronous Retry Variables | ||
|
||
The following Variables set asynchronous retries for the role. | ||
If neither of the retries or delay or retries are set, they will default to their respective defaults. | ||
This allows for all items to be created, then checked that the task finishes successfully. | ||
This also speeds up the overall role. | ||
|
||
|Variable Name|Default Value|Required|Description| | ||
|:---:|:---:|:---:|:---:| | ||
|`controller_configuration_async_retries`|30|no|This variable sets the number of retries to attempt for the role globally.| | ||
|`controller_configuration_instances_async_retries`|`{{ controller_configuration_async_retries }}`|no|This variable sets the number of retries to attempt for the role.| | ||
|`controller_configuration_async_delay`|1|no|This sets the delay between retries for the role globally.| | ||
|`controller_configuration_instances_async_delay`|`controller_configuration_async_delay`|no|This sets the delay between retries for the role.| | ||
|
||
## Data Structure | ||
|
||
### Instance Group Variables | ||
|
||
|Variable Name|Default Value|Required|Type|Description| | ||
|:---:|:---:|:---:|:---:|:---:| | ||
|`hostname`|""|yes|str|Hostname of this instance.| | ||
|`capacity_adjustment`|""|float|no|Capacity adjustment between 0 and 1. | | ||
|`enabled`|False|no|bool|If true, the instance will be enabled and used.| | ||
|`managed_by_policy`|False|no|bool|If true, will be managed by instance group policy.| | ||
|`node_type`|""|no|str|Role that this node plays in the mesh. Most likely Execution. Current options are 'execution'.| | ||
|`node_state`|""|no|str|Indicates the current life cycle stage of this instance. Current options are 'installed' and 'deprovisioning'.| | ||
|`listener_port`|""|no|int|Port that Receptor will listen for incoming connections on.| | ||
|
||
### Standard Project Data Structure | ||
|
||
#### Yaml Example | ||
|
||
```yaml | ||
--- | ||
controller_instances: | ||
- hostname: my-instance.prod.example.com | ||
capacity_adjustment: 0.4 | ||
listener_port: 31337 | ||
``` | ||
## Playbook Examples | ||
### Standard Role Usage | ||
```yaml | ||
--- | ||
- name: Playbook to configure ansible controller post installation | ||
hosts: localhost | ||
connection: local | ||
# Define following vars here, or in controller_configs/controller_auth.yml | ||
# controller_hostname: ansible-controller-web-svc-test-project.example.com | ||
# controller_username: admin | ||
# controller_password: changeme | ||
pre_tasks: | ||
- name: Include vars from controller_configs directory | ||
include_vars: | ||
dir: ./yaml | ||
ignore_files: [controller_config.yml.template] | ||
extensions: ["yml"] | ||
roles: | ||
- {role: redhat_cop.controller_configuration.instances, when: controller_instances is defined} | ||
``` | ||
## License | ||
[MIT](LICENSE) | ||
## Author | ||
[Sean Sullivan](https://github.com/sean-m-sullivan) |
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,6 @@ | ||
--- | ||
controller_instances: [] | ||
controller_configuration_instances_secure_logging: "{{ controller_configuration_secure_logging | default('false') }}" | ||
controller_configuration_instances_async_retries: "{{ controller_configuration_async_retries | default(30) }}" | ||
controller_configuration_instances_async_delay: "{{ controller_configuration_async_delay | default(1) }}" | ||
... |
Oops, something went wrong.