Commit Graph
102 Commits
Author SHA1 Message Date
aknochow 54072d6a46 fixing backup pvc namespace quotes (#2042) 2025-04-28 08:14:50 -04:00
aknochow 07540c29da fixing quotes on namespace to support namespace names with only numbers (#2030) 2025-03-17 09:19:02 -04:00
Djebran Lezzoum 848cf17d0b Deprecate LDAP auth (#1969)
deprecate external auth related configuration

issue: https://issues.redhat.com/browse/AAP-29476
2024-10-08 12:25:23 -04:00
fluzzykitten 4720d29fda Update k8s_exec and k8s_cp to include container name (#1858)
Update secrets.yml

We need to specify a container in environments that use sidecar injection, like in the case of istio service mesh. If the container is not specified, and a side car is injected so there are multiple containers running in the pod, this task will fail because a container was not specified in a pod with multiple containers.
2024-05-16 16:32:38 -04:00
Christian Adams 64e4279d96 Fix innocuous but confusing typo in db management pod task (#1859) 2024-05-16 15:17:39 -04:00
Dimitri Savineau 3fa60853a2 backup: Remove default parameter from jinja map (#1839)
CI / molecule (--skip-tags=replicas) (push) Failing after 4m29s
CI / molecule (-t replicas) (push) Failing after 3m16s
CI / helm (push) Failing after 23s
CI / no-log (push) Successful in 12s
CI / nox-sessions (push) Failing after 1m41s
The default paramater from the jinja map filter has been added in the
2.11.0 release.
However, the downstream ansible operator is still using ansible 2.9
with jinja 2.10.x so using the default parameter leads to the
following error:

TASK [Dump ingress tls secret names from awx spec and data into file]
********************************
The error was: jinja2.exceptions.FilterArgumentError: Unexpected
keyword argument 'default'
fatal: [localhost]: FAILED! => {
  "msg": "Unexpected failure during module execution.",
  "stdout": ""
}

Rather than using the default parameter with the map filter then add the
selectattr filter to get only the items with tls_secret defined and then
get the tls_secret attribute with the map filter.

This also gets rid of the when statement since we always get an empty
list when no tls_secret are present in ingress_hosts so the loop statement
will be skipped on the empty list.

Finally this changes the default value from the ingress_hosts field because
it's a list rather than a string.

https://jinja.palletsprojects.com/en/latest/templates/#jinja-filters.map

Signed-off-by: Dimitri Savineau <[email protected]>
2024-04-23 10:36:42 -04:00
kurokobo 16b2f2a34f fix: correct unsafe conditional (#1737) 2024-03-01 20:54:40 +00:00
607a7ca58c Upgrading to PostgreSQL 15 and moving to sclorg images (#1486)
* Upgrading to postgres:15
* Changing image from postgres to sclorg
* Handle scenario where upgrade status is not defined & correct pg tag
* Rework the upgrade logic to be more resiliant for multiple upgrades

---------

Co-authored-by: john-westcott-iv <[email protected]>
Co-authored-by: Christian M. Adams <[email protected]>
2024-02-29 17:02:11 -05:00
07427be0b7 Allow multiple ingress hosts to be defined when using ingress (#1377)
* Replace api version for deployment kind to apps/v1

* Add new multiple ingress spec and deprecate hostname and ingress_tls_secret

* Manage new ingress_hosts.tls_secret backup separately

* Fix ci molecule lint warnings and error

* Fix documentation

* Fix ingress_hosts tls_secret key being optional

* Remove fieldDependency:ingress_type:Ingress for Ingress Hosts

* Fix scenario when neither hostname or ingress_hosts is defined

---------

Co-authored-by: Guillaume Lefevre <[email protected]>
Co-authored-by: Seth Foster <[email protected]>
Co-authored-by: Christian Adams <[email protected]>
2024-01-05 10:15:04 -05:00
Hao Liu 25a6c3c48a Remove unnessary chmod and chown for db dump (#1667)
Based on https://github.com/ansible/awx-operator/pull/1602

Fixes https://github.com/ansible/awx-operator/issues/1590
2023-12-13 19:28:23 +00:00
ImedandImed Aouidene a9245454a4 Remove reference to cluster.local (#1566)
Co-authored-by: Imed Aouidene <[email protected]>
2023-11-27 16:26:24 +00:00
Hao Liu 92639c1e89 Adding keepalive while doing pg_dump (#1580)
CI / molecule (--skip-tags=replicas) (push) Failing after 2m19s
CI / molecule (-t replicas) (push) Failing after 2m4s
CI / helm (push) Failing after 3m57s
CI / no-log (push) Successful in 15s
2023-10-10 13:08:51 -04:00
kurokobo a7cfbe23da fix: correct label selector to find task pod (#1573) 2023-10-03 14:08:54 -04:00
jessicamack 31e1914db6 Pre-create event table partitions before db backup in operator (#1443)
CI / molecule (--skip-tags=replicas) (push) Failing after 2m11s
CI / molecule (-t replicas) (push) Failing after 2m22s
CI / helm (push) Failing after 2m58s
CI / no-log (push) Successful in 16s
Signed-off-by: jessicamack <[email protected]>
<[email protected]>
2023-09-26 10:20:12 -04:00
rakesh561 43c1f396c3 Updated image pull policy for backup and restore policy as variable (#1473) 2023-07-05 14:39:43 -04:00
fcc09673cc Add db_management_pod_node_selector for specifying nodeSelect for backup/restore mgmt pod (#1434)
Co-authored-by: Hao Liu <[email protected]>
Co-authored-by: Jesse Wattenbarger <[email protected]>
2023-06-21 10:46:29 -04:00
David Luong 61ef5ef005 change date format to avoid : 2023-03-02 13:54:00 -05:00
Stanislav Zaprudskiy f042cb3d00 Fix lint warnings 2023-02-07 16:31:26 +01:00
Stanislav Zaprudskiy 5a856eeba8 Add additional_labels parameter (#1160)
* Move label templates into `common` role

So that there is single source of labels management, and labels are
unified across the other roles

* Introduce `additional_labels`
* Fix paths for labels templates
* Return `additional_labels_items` as list
* Add molecule tests
2023-01-30 18:51:08 -05:00
Joel ab566c2530 backup role use k8s_cp module to write files (#1111) 2023-01-24 17:02:05 -05:00
Mathijsvw 4ee523ed69 Added pg_dump_suffix doc and crd property (#1006)
* Added pg_dump_suffix crd property

Signed-off-by: Mathijs van Willigen <[email protected]>
2022-12-14 14:56:40 -05:00
Christian Adams a5e21b56ae Backup and restore receptor tls secret with expected generated name (#1107) 2022-11-07 11:04:22 -05:00
Christian Adams 6b01ff09ce Amend permissions for backup dir (#1109) 2022-11-03 12:52:48 -04:00
Christian M. Adams d3ca9c57c9 One more no_log default update 2022-10-04 11:36:56 -04:00
Jeremy White a81be586db update filter to jinja 3.x format 2022-08-24 14:56:08 -05:00
9f017d03e6 Make Backup & restore requests and limits configurable (#1030)
* Add resource specification options to the backup objects
* Add resource specification options to the restore object

Co-authored-by: Ivan Aragonés <[email protected]>
Co-authored-by: silvinux <[email protected]>
Co-authored-by: Ivan Aragonés Muniesa <[email protected]>
2022-08-23 23:23:01 -04:00
kurokobo f1df88dc53 fix: change to safely skip task if backupDirectory is not defined (#1003) (#1004) 2022-08-04 10:42:43 -04:00
Christian AdamsandDimitri Savineau fde4a47a14 Bump dependencies stream (#841)
* Bump Postgresql, Nginx and Redis versions
* pg12 --> pg13 upgrade path
* Set supported pg version as a variable to remain DRY
* Make deleting the old db data pvc after upgrade configurable
* Use labels to find the postgres pod

* backup/restore: fix postgres label selector value

We need to use the deployment_name variable for the postgres instance
name.

Signed-off-by: Dimitri Savineau <[email protected]>

* backup/restore: add missing default supported_pg_version variable

Signed-off-by: Dimitri Savineau <[email protected]>

* restore: update database_host fact with pg suffix

Signed-off-by: Dimitri Savineau <[email protected]>

Co-authored-by: Dimitri Savineau <[email protected]>
2022-07-29 13:21:51 -04:00
Shane McDonald 0be17476cd Merge pull request #979 from stanislav-zaprudskiy/allow_skipping_labels_patching_on_awx_resource
Introduce `set_self_labels` in CRDs
2022-07-20 12:41:20 -04:00
Christian Adams b3037c1067 Deprecate the backup_pvc_namespace field (#988)
- Removes backup_pvc_namespace field from OLM forms
  - This field has created confusion for users and there is no strong
    case for needing this functionality
  - Users will still be able to add it to the yaml for the CR if they
    want to use it with the cluster-scoped AWX operator
  - Remove unneeded advanced descriptors to avoid empty Advanced
    configuration expander

fixes AAP-1176
2022-07-18 17:35:11 -04:00
Stanislav Zaprudskiy 36355b6a15 Introduce set_self_labels in CRDs
To allow skipping labels maintenance on CRs processed by the operator.
Resolves https://github.com/ansible/awx-operator/issues/756
2022-07-12 10:48:16 +02:00
Stefan de Kooter 59036fc373 Add free format pg_dump backup parameter 2022-07-10 19:03:32 +00:00
Viviana Capote 05943687fe Added option to also delete backup directory on PVC when AWXBackup CRD object is deleted 2022-06-27 15:45:33 +10:00
David Luong e966e9299f Resolves #918 to make no_log configurable (#923) 2022-06-16 01:03:13 -04:00
Christian Adams 1b41d945e6 Check if image_pull_secrets variable is defined (#865)
* Do not attempt to backup secret if none are defined
2022-04-11 11:10:09 -04:00
Christian Adams 575e594314 Wait for the postgres pod to enter the ready state before starting containers (#861) 2022-04-06 08:29:53 -04:00
Christian AdamsandMaximilian Meister 5f76d4917e Enable setting a list of image_pull_secrets (#860)
When there are e.g. multiple authenticated container registries used
we need to be able to add multiple imagePullSecrets to the k8s resource

Co-authored-by: Maximilian Meister <[email protected]>
2022-04-05 11:51:21 -04:00
kurokobo 589a3751e1 fix: add quotes for PGPASSWORD for the backup and restore roles 2022-03-20 16:13:12 +09:00
Yanis Guenane fc713e7b73 Properly apply default when env lookup returns empty 2021-11-02 09:57:04 +01:00
Christian M. Adams 7eb6d0e0f5 Set default images, but use them as a last resort
* Only use them if user did not set an image, or RELATED_IMAGES_ var
    is not set

Signed-off-by: Christian M. Adams <[email protected]>
(cherry picked from commit bb957be9e6db76e0d681cf0d08b5519225bca53c)
2021-11-01 14:58:24 +01:00
Christian M. Adams 29879f7064 Rename related image vars to be distinct across operators 2021-10-27 11:26:51 -04:00
Christian M. Adams 8aee279634 Use relatedImages to make disconnected deployments possible
* Add ability to pass images in from the CSV for disconnected installs

Signed-off-by: Christian M. Adams <[email protected]>
2021-10-26 00:26:16 -04:00
Shane McDonald 8b64670146 Work around bug in k8s module with the "template" attribute 2021-09-29 20:24:00 -04:00
Shane McDonald 69203723ef Update scaffolding to pass yamllint 2021-09-29 18:39:24 -04:00
Shane McDonald e97def4429 meta -> ansible_operator_meta 2021-09-29 18:39:24 -04:00
Christian M. Adams 68b00efe5e Set no_log on all tasks that could leak secrets in logs 2021-07-07 18:19:31 -04:00
Julen Landa Alustiza 663c009cf4 Backup and restore secret type
Signed-off-by: Julen Landa Alustiza <[email protected]>
2021-07-02 13:07:44 +02:00
Christian M. Adams cf2cd14154 Do not check for default ee-pull-cred secret
* fix nested var ref for awx_spec.spec
2021-07-01 15:05:18 -04:00
Christian M. Adams 8b2bfa7380 Fix var so that generated secret names are added to spec backup 2021-06-30 10:57:42 -04:00
Christian M. Adams 6b01ada12b preserve newlines in AWX spec 2021-06-28 17:39:01 -04:00