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

Ansible code bot recommendations #4

Open
wants to merge 1 commit into
base: devel
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
6 changes: 3 additions & 3 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
skip_list:
- '306'
- '602'
- '503'
- "306"
- "602"
- "503"

exclude_paths:
- deploy/
Expand Down
4 changes: 2 additions & 2 deletions .helm/starter/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
apiVersion: v2
appVersion: 0.1.0
appVersion: "0.1.0"
description: A Helm chart for Kubernetes
name: starter
type: application
version: 0.1.0
version: "0.1.0"
1 change: 1 addition & 0 deletions .helm/starter/values.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
AWX:
# enable use of awx-deploy template
enabled: false
Expand Down
3 changes: 2 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

Expand All @@ -14,4 +15,4 @@ mkdocs:

python:
install:
- requirements: ./docs/requirements.txt
- requirements: ./docs/requirements.txt
28 changes: 14 additions & 14 deletions ansible/helm-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
tasks:
- name: Look up release
uri:
url: "https://api.github.com/repos/{{ chart_owner }}/{{ chart_repo }}/releases/tags/{{ tag }}"
url: https://api.github.com/repos/{{ chart_owner }}/{{ chart_repo }}/releases/tags/{{ tag }}
register: release
ignore_errors: yes
ignore_errors: true

- fail:
msg: |
Expand All @@ -18,13 +18,13 @@

- name: Set helm filename and commit message
set_fact:
asset_already_attached: False
helm_file_name: "awx-operator-{{ tag }}.tgz"
commit_message: "Updated index.yaml for release {{ release.json.tag_name }}"
asset_already_attached: false
helm_file_name: awx-operator-{{ tag }}.tgz
commit_message: Updated index.yaml for release {{ release.json.tag_name }}

- name: See if file is already attached
set_fact:
asset_already_attached: True
asset_already_attached: true
loop: "{{ release.json.get('assets', []) }}"
loop_control:
label: "{{ item.name }}"
Expand All @@ -44,11 +44,11 @@
# Move to chart releaser after https://github.com/helm/chart-releaser/issues/122 exists
- name: Upload helm chart
uri:
url: "https://uploads.github.com/repos/{{ chart_owner }}/{{ chart_repo }}/releases/{{ release.json.id }}/assets?name={{ helm_file_name }}"
url: https://uploads.github.com/repos/{{ chart_owner }}/{{ chart_repo }}/releases/{{ release.json.id }}/assets?name={{ helm_file_name }}
src: "{{ playbook_dir }}/../.cr-release-packages/{{ tag }}/awx-operator-{{ tag }}.tgz"
headers:
Authorization: "token {{ gh_token }}"
Content-Type: "application/octet-stream"
Authorization: token {{ gh_token }}
Content-Type: application/octet-stream
status_code:
- 200
- 201
Expand All @@ -62,7 +62,7 @@

- name: Check if we have published the release
command:
cmd: "git log --grep='{{ commit_message }}'"
cmd: git log --grep='{{ commit_message }}'
chdir: "{{ playbook_dir }}/../gh-pages"
register: commits_for_release

Expand All @@ -77,11 +77,11 @@
git:
repo: "{{ ((repo_type | default('http')) == 'ssh') | ternary(ssh_repo, http_repo) }}"
dest: "{{ temp_dir.path }}"
single_branch: yes
single_branch: true
version: gh-pages
vars:
http_repo: "https://github.com/{{ chart_owner }}/{{ chart_repo }}"
ssh_repo: "[email protected]:{{ chart_owner }}/{{ chart_repo }}.git"
http_repo: https://github.com/{{ chart_owner }}/{{ chart_repo }}
ssh_repo: [email protected]:{{ chart_owner }}/{{ chart_repo }}.git

- name: Publish helm index
ansible.builtin.command:
Expand All @@ -95,7 +95,7 @@

- name: Set url base swap in gitconfig
command:
cmd: "git config --local url.https://{{ gh_user }}:{{ gh_token }}@github.com/.insteadOf https://github.com/"
cmd: git config --local url.https://{{ gh_user }}:{{ gh_token }}@github.com/.insteadOf https://github.com/
args:
chdir: "{{ temp_dir.path }}/"
no_log: true
Expand Down
8 changes: 4 additions & 4 deletions ansible/instantiate-awx-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
k8s:
state: "{{ state | default('present') }}"
namespace: "{{ namespace | default('default') }}"
apply: yes
wait: yes
apply: true
wait: true
definition:
apiVersion: awx.ansible.com/v1beta1
kind: AWX
Expand All @@ -20,8 +20,8 @@
spec:
admin_user: admin
admin_email: admin@localhost
service_type: "{{ service_type | default(omit) }}" # Either clusterIP, Loadbalancer or NodePort
ingress_type: "{{ ingress_type | default(omit) }}" # Either none, Ingress, Route
service_type: "{{ service_type | default(omit) }}" # Either clusterIP, Loadbalancer or NodePort

Check warning on line 23 in ansible/instantiate-awx-deployment.yml

View workflow job for this annotation

GitHub Actions / molecule (-t replicas)

23:64 [comments] too few spaces before comment

Check warning on line 23 in ansible/instantiate-awx-deployment.yml

View workflow job for this annotation

GitHub Actions / molecule (--skip-tags=replicas)

23:64 [comments] too few spaces before comment

Check warning on line 23 in ansible/instantiate-awx-deployment.yml

View workflow job for this annotation

GitHub Actions / molecule (-t replicas)

23:64 [comments] too few spaces before comment

Check warning on line 23 in ansible/instantiate-awx-deployment.yml

View workflow job for this annotation

GitHub Actions / molecule (--skip-tags=replicas)

23:64 [comments] too few spaces before comment
ingress_type: "{{ ingress_type | default(omit) }}" # Either none, Ingress, Route

Check warning on line 24 in ansible/instantiate-awx-deployment.yml

View workflow job for this annotation

GitHub Actions / molecule (-t replicas)

24:64 [comments] too few spaces before comment

Check warning on line 24 in ansible/instantiate-awx-deployment.yml

View workflow job for this annotation

GitHub Actions / molecule (--skip-tags=replicas)

24:64 [comments] too few spaces before comment

Check warning on line 24 in ansible/instantiate-awx-deployment.yml

View workflow job for this annotation

GitHub Actions / molecule (-t replicas)

24:64 [comments] too few spaces before comment

Check warning on line 24 in ansible/instantiate-awx-deployment.yml

View workflow job for this annotation

GitHub Actions / molecule (--skip-tags=replicas)

24:64 [comments] too few spaces before comment
image: "{{ image | default(omit) }}"
image_version: "{{ image_version | default(omit) }}"
development_mode: "{{ development_mode | default(omit) | bool }}"
Expand Down
248 changes: 122 additions & 126 deletions config/crd/bases/awx.ansible.com_awxbackups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,136 +12,132 @@ spec:
singular: awxbackup
scope: Namespaced
versions:
- name: v1beta1
served: true
storage: true
subresources:
status: {}
schema:
openAPIV3Schema:
type: object
description: Schema validation for the AWXBackup CRD
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- deployment_name
properties:
deployment_name:
description: Name of the deployment to be backed up
type: string
backup_pvc:
description: Name of the backup PVC
type: string
backup_pvc_namespace:
description: (Deprecated) Namespace the PVC is in
type: string
backup_storage_requirements:
description: Storage requirements for backup PVC (may be similar to existing postgres PVC backing up from)
type: string
backup_resource_requirements:
description: Resource requirements for the management pod used to create a backup
properties:
requests:
- name: v1beta1
served: true
storage: true
subresources:
status: {}
schema:
openAPIV3Schema:
type: object
description: Schema validation for the AWXBackup CRD
properties:
apiVersion:
description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal
value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources"
type: string
kind:
description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits
requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds"
type: string
metadata:
type: object
spec:
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- deployment_name
properties:
deployment_name:
description: Name of the deployment to be backed up
type: string
backup_pvc:
description: Name of the backup PVC
type: string
backup_pvc_namespace:
description: (Deprecated) Namespace the PVC is in
type: string
backup_storage_requirements:
description: Storage requirements for backup PVC (may be similar to existing postgres PVC backing up from)
type: string
backup_resource_requirements:
description: Resource requirements for the management pod used to create a backup
properties:
requests:
properties:
cpu:
type: string
memory:
type: string
type: object
limits:
properties:
cpu:
type: string
memory:
type: string
type: object
type: object
backup_storage_class:
description: Storage class to use when creating PVC for backup
type: string
clean_backup_on_delete:
description: Flag to indicate if backup should be deleted on PVC if AWXBackup object is deleted
type: boolean
pg_dump_suffix:
description: Additional parameters for the pg_dump command
type: string
postgres_label_selector:
description: Label selector used to identify postgres pod for backing up data
type: string
postgres_image:
description: Registry path to the PostgreSQL container to use
type: string
postgres_image_version:
description: PostgreSQL container image version to use
type: string
precreate_partition_hours:
description: Number of hours worth of events table partitions to precreate before backup to avoid pg_dump locks.
type: integer
format: int32
image_pull_policy:
description: The image pull policy
type: string
default: IfNotPresent
enum:
- Always
- always
- Never
- never
- IfNotPresent
- ifnotpresent
db_management_pod_node_selector:
description: nodeSelector for the Postgres pods to backup
type: string
no_log:
description: Configure no_log for no_log tasks
type: boolean
default: true
additional_labels:
description: Additional labels defined on the resource, which should be propagated to child resources
type: array
items:
type: string
set_self_labels:
description: Maintain some of the recommended `app.kubernetes.io/*` labels on the resource (self)
type: boolean
default: true
status:
type: object
x-kubernetes-preserve-unknown-fields: true
properties:
conditions:
description: The resulting conditions when a Service Telemetry is instantiated
items:
properties:
cpu:
lastTransitionTime:
type: string
memory:
reason:
type: string
type: object
limits:
properties:
cpu:
status:
type: string
memory:
type:
type: string
type: object
type: object
backup_storage_class:
description: Storage class to use when creating PVC for backup
type: string
clean_backup_on_delete:
description: Flag to indicate if backup should be deleted on PVC if AWXBackup object is deleted
type: boolean
pg_dump_suffix:
description: Additional parameters for the pg_dump command
type: string
postgres_label_selector:
description: Label selector used to identify postgres pod for backing up data
type: string
postgres_image:
description: Registry path to the PostgreSQL container to use
type: string
postgres_image_version:
description: PostgreSQL container image version to use
type: string
precreate_partition_hours:
description: Number of hours worth of events table partitions to precreate before backup to avoid pg_dump locks.
type: integer
format: int32
image_pull_policy:
description: The image pull policy
type: string
default: IfNotPresent
enum:
- Always
- always
- Never
- never
- IfNotPresent
- ifnotpresent
db_management_pod_node_selector:
description: nodeSelector for the Postgres pods to backup
type: string
no_log:
description: Configure no_log for no_log tasks
type: boolean
default: true
additional_labels:
description: Additional labels defined on the resource, which should be propagated to child resources
type: array
items:
type: array
backupDirectory:
description: Backup directory name on the specified pvc
type: string
backupClaim:
description: Backup persistent volume claim
type: string
set_self_labels:
description: Maintain some of the recommended `app.kubernetes.io/*` labels on the resource (self)
type: boolean
default: true
status:
type: object
x-kubernetes-preserve-unknown-fields: true
properties:
conditions:
description: The resulting conditions when a Service Telemetry is instantiated
items:
properties:
lastTransitionTime:
type: string
reason:
type: string
status:
type: string
type:
type: string
type: object
type: array
backupDirectory:
description: Backup directory name on the specified pvc
type: string
backupClaim:
description: Backup persistent volume claim
type: string
Loading
Loading