Skip to content

Commit

Permalink
make ansible-lint happy
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed May 29, 2024
1 parent 45bc79a commit 9033a13
Show file tree
Hide file tree
Showing 18 changed files with 105 additions and 147 deletions.
1 change: 1 addition & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ only_builtins_allow_collections:
- theforeman.foreman
exclude_paths:
- meta/runtime.yml
- plugins/inventory/foreman.py
- tests/
- .github/
33 changes: 0 additions & 33 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -1,39 +1,6 @@
---
# Based on ansible-lint config
extends: default

rules:
braces:
max-spaces-inside: 1
level: error
brackets:
max-spaces-inside: 1
level: error
colons:
max-spaces-after: -1
level: error
commas:
max-spaces-after: -1
level: error
comments: disable
comments-indentation: disable
document-start:
present: true
empty-lines:
max: 3
level: error

hyphens:
level: error
indentation: {spaces: 2, indent-sequences: consistent}
key-duplicates: enable
line-length: disable
new-line-at-end-of-file: disable
new-lines:
type: unix
trailing-spaces: enable
truthy:
level: error

ignore: |
tests/test_playbooks/fixtures/
8 changes: 4 additions & 4 deletions plugins/modules/activation_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,11 @@
lifecycle_environment: "Library"
content_view: 'client content view'
host_collections:
- rhel7-servers
- rhel7-production
- rhel7-servers
- rhel7-production
content_overrides:
- label: rhel-7-server-optional-rpms
override: enabled
- label: rhel-7-server-optional-rpms
override: enabled
auto_attach: false
release_version: 7Server
service_level: Standard
Expand Down
80 changes: 40 additions & 40 deletions plugins/modules/compute_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@
theforeman.foreman.compute_profile:
name: another_example_compute_profile
compute_attributes:
- compute_resource: ovirt_compute_resource1
vm_attrs:
cluster: 'a96d44a4-f14a-1015-82c6-f80354acdf01'
template: 'c88af4b7-a24a-453b-9ac2-bc647ca2ef99'
instance_type: 'cb8927e7-a404-40fb-a6c1-06cbfc92e077'
- compute_resource: ovirt_compute_resource1
vm_attrs:
cluster: 'a96d44a4-f14a-1015-82c6-f80354acdf01'
template: 'c88af4b7-a24a-453b-9ac2-bc647ca2ef99'
instance_type: 'cb8927e7-a404-40fb-a6c1-06cbfc92e077'
server_url: "https://foreman.example.com"
username: "admin"
password: "changeme"
Expand All @@ -87,41 +87,41 @@
theforeman.foreman.compute_profile:
name: example_compute_profile2
compute_attributes:
- compute_resource: ovirt_compute_resource01
vm_attrs:
cluster: a96d44a4-f14a-1015-82c6-f80354acdf01
cores: 1
sockets: 1
memory: 1073741824
ha: 0
interfaces_attributes:
0:
name: ""
network: 390666e1-dab3-4c99-9f96-006b2e2fd801
interface: virtio
volumes_attributes:
0:
size_gb: 16
storage_domain: 19c50090-1ab4-4023-a63f-75ee1018ed5e
preallocate: '1'
wipe_after_delete: '0'
interface: virtio_scsi
bootable: 'true'
- compute_resource: libvirt_compute_resource03
vm_attrs:
cpus: 1
memory: 2147483648
nics_attributes:
0:
type: bridge
bridge: ""
model: virtio
volumes_attributes:
0:
pool_name: default
capacity: 16G
allocation: 16G
format_type: raw
- compute_resource: ovirt_compute_resource01
vm_attrs:
cluster: a96d44a4-f14a-1015-82c6-f80354acdf01
cores: 1
sockets: 1
memory: 1073741824
ha: 0
interfaces_attributes:
0:
name: ""
network: 390666e1-dab3-4c99-9f96-006b2e2fd801
interface: virtio
volumes_attributes:
0:
size_gb: 16
storage_domain: 19c50090-1ab4-4023-a63f-75ee1018ed5e
preallocate: '1'
wipe_after_delete: '0'
interface: virtio_scsi
bootable: 'true'
- compute_resource: libvirt_compute_resource03
vm_attrs:
cpus: 1
memory: 2147483648
nics_attributes:
0:
type: bridge
bridge: ""
model: virtio
volumes_attributes:
0:
pool_name: default
capacity: 16G
allocation: 16G
format_type: raw
server_url: "https://foreman.example.com"
username: "admin"
password: "changeme"
Expand Down
1 change: 0 additions & 1 deletion plugins/modules/compute_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,6 @@
username: "admin"
password: "changeme"
state: present
'''

RETURN = '''
Expand Down
1 change: 0 additions & 1 deletion plugins/modules/content_export_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@
password: "changeme"
server_url: "https://foreman.example.com"
organization: "Default Organization"
'''

from ansible_collections.theforeman.foreman.plugins.module_utils.foreman_helper import KatelloInfoAnsibleModule
Expand Down
34 changes: 17 additions & 17 deletions plugins/modules/content_export_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,26 +90,26 @@
- name: "Export content view version (incremental) since the most recent export"
theforeman.foreman.content_export_version:
content_view: RHEL8
content_view_version: '1.0'
username: "admin"
password: "changeme"
server_url: "https://foreman.example.com"
organization: "Default Organization"
destination_server: "airgapped.example.com"
incremental: true
content_view: RHEL8
content_view_version: '1.0'
username: "admin"
password: "changeme"
server_url: "https://foreman.example.com"
organization: "Default Organization"
destination_server: "airgapped.example.com"
incremental: true
- name: "Export content view version (incremental) since a specific export"
theforeman.foreman.content_export_version:
content_view: RHEL8
content_view_version: '1.0'
username: "admin"
password: "changeme"
server_url: "https://foreman.example.com"
organization: "Default Organization"
destination_server: "airgapped.example.com"
incremental: true
from_history_id: 12345
content_view: RHEL8
content_view_version: '1.0'
username: "admin"
password: "changeme"
server_url: "https://foreman.example.com"
organization: "Default Organization"
destination_server: "airgapped.example.com"
incremental: true
from_history_id: 12345
'''

from ansible_collections.theforeman.foreman.plugins.module_utils.foreman_helper import KatelloContentExportBaseModule
Expand Down
1 change: 0 additions & 1 deletion plugins/modules/content_view_filter_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
server_url: "https://foreman.example.com"
content_view: "SOE_RHEL9"
name: "AllRPMNoErrata"
'''

RETURN = '''
Expand Down
1 change: 0 additions & 1 deletion plugins/modules/content_view_filter_rule_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
content_view: "SOE_RHEL9"
content_view_filter: "NoFireFox"
name: firefox
'''

RETURN = '''
Expand Down
36 changes: 18 additions & 18 deletions plugins/modules/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,11 +327,11 @@
server_url: "https://foreman.example.com"
name: "new_host"
interfaces_attributes:
- type: "interface"
compute_attributes:
name: "nic1"
network: "969efbe6-f9e0-4383-a19a-a7ee65ad5007"
interface: "virtio"
- type: "interface"
compute_attributes:
name: "nic1"
network: "969efbe6-f9e0-4383-a19a-a7ee65ad5007"
interface: "virtio"
state: present
- name: "Create a VM with 2 NICs on specific ovirt networks"
Expand All @@ -341,19 +341,19 @@
server_url: "https://foreman.example.com"
name: "new_host"
interfaces_attributes:
- type: "interface"
primary: true
compute_attributes:
name: "nic1"
network: "969efbe6-f9e0-4383-a19a-a7ee65ad5007"
interface: "virtio"
- type: "interface"
name: "new_host_nic2"
managed: true
compute_attributes:
name: "nic2"
network: "969efbe6-f9e0-4383-a19a-a7ee65ad5008"
interface: "e1000"
- type: "interface"
primary: true
compute_attributes:
name: "nic1"
network: "969efbe6-f9e0-4383-a19a-a7ee65ad5007"
interface: "virtio"
- type: "interface"
name: "new_host_nic2"
managed: true
compute_attributes:
name: "nic2"
network: "969efbe6-f9e0-4383-a19a-a7ee65ad5008"
interface: "e1000"
state: present
- name: "Delete a host"
Expand Down
6 changes: 2 additions & 4 deletions plugins/modules/host_power.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@
password: "changeme"
server_url: "https://foreman.example.com"
hostname: "test-host.domain.test"
state: on
state: 'on'
- name: "Switch a host off"
theforeman.foreman.host_power:
username: "admin"
password: "changeme"
server_url: "https://foreman.example.com"
hostname: "test-host.domain.test"
state: off
state: 'off'
- name: "Query host power state"
theforeman.foreman.host_power:
Expand All @@ -83,8 +83,6 @@
register: result
- debug:
msg: "Host power state is {{ result.power_state }}"
'''

RETURN = '''
Expand Down
1 change: 0 additions & 1 deletion plugins/modules/job_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@
- DALEK INC
- sky.net
- Doc Brown's garage
'''

RETURN = '''
Expand Down
1 change: 0 additions & 1 deletion plugins/modules/partition_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@
- DALEK INC
- sky.net
- Doc Brown's garage
'''

RETURN = '''
Expand Down
1 change: 0 additions & 1 deletion plugins/modules/provisioning_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@
- DALEK INC
- sky.net
- Doc Brown's garage
'''

RETURN = '''
Expand Down
32 changes: 16 additions & 16 deletions plugins/modules/repository_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@
organization: "Default Organization"
product: "Red Hat Enterprise Linux Server"
repositories:
- releasever: "7.0"
basearch: "x86_64"
- releasever: "7.1"
basearch: "x86_64"
- releasever: "7.2"
basearch: "x86_64"
- releasever: "7.3"
basearch: "x86_64"
- releasever: "7.0"
basearch: "x86_64"
- releasever: "7.1"
basearch: "x86_64"
- releasever: "7.2"
basearch: "x86_64"
- releasever: "7.3"
basearch: "x86_64"
state: enabled
- name: "Enable RHEL 7 RPMs repositories with label"
Expand All @@ -109,14 +109,14 @@
organization: "Default Organization"
label: rhel-7-server-rpms
repositories:
- releasever: "7.0"
basearch: "x86_64"
- releasever: "7.1"
basearch: "x86_64"
- releasever: "7.2"
basearch: "x86_64"
- releasever: "7.3"
basearch: "x86_64"
- releasever: "7.0"
basearch: "x86_64"
- releasever: "7.1"
basearch: "x86_64"
- releasever: "7.2"
basearch: "x86_64"
- releasever: "7.3"
basearch: "x86_64"
state: enabled
- name: "Disable RHEL 7 Extras RPMs repository"
Expand Down
8 changes: 4 additions & 4 deletions plugins/modules/subnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,12 @@
vlanid: 452
mtu: 9000
domains:
- "foo.example.com"
- "bar.example.com"
- "foo.example.com"
- "bar.example.com"
organizations:
- "Example Org"
- "Example Org"
locations:
- "Toulouse"
- "Toulouse"
server_url: "https://foreman.example.com"
username: "admin"
password: "changeme"
Expand Down
Loading

0 comments on commit 9033a13

Please sign in to comment.