Skip to content

Commit

Permalink
fixed requirements with no-deps and ansible-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
cicharka committed Apr 10, 2024
1 parent 8b6f9ba commit 435d317
Show file tree
Hide file tree
Showing 3 changed files with 197 additions and 75 deletions.
137 changes: 137 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
---
# .ansible-lint

profile: production # min, basic, moderate, safety, shared, production

# Allows dumping of results in SARIF format
# sarif_file: result.sarif

# exclude_paths included in this file are parsed relative to this file's location
# and not relative to the CWD of execution. CLI arguments passed to the --exclude
# option are parsed relative to the CWD of execution.
exclude_paths:
- playbooks/shared/
- playbooks/results/
- playbooks/ansible_catalystwan.log
- playbooks/ansible_catalystwan_module.log
- playbooks/azure/ansible_catalystwan.log
- playbooks/azure/ansible_catalystwan_module.log
- playbooks/azure/results/
- playbooks/aws/ansible_catalystwan.log
- playbooks/aws/ansible_catalystwan_module.log
- playbooks/aws/results/
# parseable: true
# quiet: true
# strict: true
verbosity: 1

# # Mock modules or roles in order to pass ansible-playbook --syntax-check
# mock_modules:
# - zuul_return
# # note the foo.bar is invalid as being neither a module or a collection
# - fake_namespace.fake_collection.fake_module
# - fake_namespace.fake_collection.fake_module.fake_submodule
# mock_roles:
# - mocked_role
# - author.role_name # old standalone galaxy role
# - fake_namespace.fake_collection.fake_role # role within a collection

# Enable checking of loop variable prefixes in roles
loop_var_prefix: "^(__|{role}_)"

# Enforce variable names to follow pattern below, in addition to Ansible own
# requirements, like avoiding python identifiers. To disable add `var-naming`
# to skip_list.
var_naming_pattern: "^[a-z_][a-z0-9_]*$"

use_default_rules: true
# Load custom rules from this specific folder
# rulesdir:
# - ./rule/directory/

# Ansible-lint is able to recognize and load skip rules stored inside
# `.ansible-lint-ignore` (or `.config/ansible-lint-ignore.txt`) files.
# To skip a rule just enter filename and tag, like "playbook.yml package-latest"
# on a new line.
# Optionally you can add comments after the tag, prefixed by "#". We discourage
# the use of skip_list below because that will hide violations from the output.
# When putting ignores inside the ignore file, they are marked as ignored, but
# still visible, making it easier to address later.
skip_list:
- skip_this_tag
- name[prefix]
- var-naming[no-role-prefix]
- loop-var-prefix[wrong]
- galaxy[no-changelog] # FIXME after release
- galaxy[version-incorrect] # FIXME after release

# Ansible-lint does not automatically load rules that have the 'opt-in' tag.
# You must enable opt-in rules by listing each rule 'id' below.
enable_list:
- args
- empty-string-compare # opt-in
- no-log-password # opt-in
- no-same-owner # opt-in
- name[prefix] # opt-in
# add yaml here if you want to avoid ignoring yaml checks when yamllint
# library is missing. Normally its absence just skips using that rule.
- yaml
# Report only a subset of tags and fully ignore any others
# tags:
# - jinja[spacing]

# Ansible-lint does not fail on warnings from the rules or tags listed below
warn_list:
- skip_this_tag
- experimental # experimental is included in the implicit list

# - role-name
# - yaml[document-start] # you can also use sub-rule matches

# Some rules can transform files to fix (or make it easier to fix) identified
# errors. `ansible-lint --fix` will reformat YAML files and run these transforms.
# By default it will run all transforms (effectively `write_list: ["all"]`).
# You can disable running transforms by setting `write_list: ["none"]`.
# Or only enable a subset of rule transforms by listing rules/tags here.
# write_list:
# - all

# Offline mode disables installation of requirements.yml and schema refreshing
offline: true

# Define required Ansible's variables to satisfy syntax check
extra_vars:
foo: bar
multiline_string_variable: |
line1
line2
complex_variable: ":{;\t$()"

# Uncomment to enforce action validation with tasks, usually is not
# needed as Ansible syntax check also covers it.
# skip_action_validation: false

# List of additional kind:pattern to be added at the top of the default
# match list, first match determines the file kind.
kinds:
# - playbook: "**/examples/*.{yml,yaml}"
# - galaxy: "**/folder/galaxy.yml"
# - tasks: "**/tasks/*.yml"
# - vars: "**/vars/*.yml"
# - meta: "**/meta/main.yml"
- yaml: "**/*.yaml-too"

# List of additional collections to allow in only-builtins rule.
# only_builtins_allow_collections:
# - example_ns.example_collection

# List of additions modules to allow in only-builtins rule.
# only_builtins_allow_modules:
# - example_module

# Allow setting custom prefix for name[prefix] rule
task_name_prefix: "{stem} | "
# Complexity related settings

# Limit the depth of the nested blocks:
# max_block_depth: 20
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,12 @@ source <your-venv-name>/bin/activate
And then install python and ansible requirements:

```bash
pip install -r requirements.txt
pip install -r requirements.txt --no-deps
ansible-galaxy install -r requirements.yml
```

Note: For python packages installation troubleshooting see [python-packages-installation](#5-python-packages-installation)

Verify that your ansible version is using python modules from vevn by using test playbook:

For AWS:
Expand Down Expand Up @@ -241,6 +243,19 @@ ansible-galaxy collection install -r requirements.yml --upgrade

Ansible defaults to installing the collection in `~/.ansible/collections`. This can cause problems if you're using the wrong collection version. Ensure your collection version is correct if you run into issues.

### 5. Python packages installation

Python packages requirements are formed to include all dependencies.
Therefore if you face issues with installation, note that there is known confict:

```log
The user requested packaging
catalystwan 0.31.2 depends on packaging<24.0 and >=23.0
azure-cli-core 2.34.0 depends on packaging<22.0 and >=20.9
```

solved by using: `pip install -r requirements.txt --no-deps` command.

---

## Containerized variant WIP
Expand Down
118 changes: 44 additions & 74 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,71 +1,67 @@
adal==1.2.7
aiohttp==3.9.3
aiosignal==1.3.1
annotated-types==0.6.0
ansible==9.4.0
ansible-core==2.16.5
anyio==4.3.0
applicationinsights==0.11.10
argcomplete==3.1.6
argcomplete==1.12.3
args==0.1.0
attrs==21.4.0
azure-cli-core==2.34.0
azure-cli-telemetry==1.0.6
azure-common==1.1.28
azure-containerregistry==1.2.0
azure-core==1.30.1
azure-common==1.1.11
azure-containerregistry==1.1.0
azure-core==1.28.0
azure-graphrbac==0.61.1
azure-identity==1.15.0
azure-identity==1.7.0
azure-keyvault==4.2.0
azure-keyvault-certificates==4.8.0
azure-keyvault-keys==4.9.0
azure-keyvault-secrets==4.8.0
azure-mgmt-apimanagement==4.0.1
azure-mgmt-authorization==4.0.0
azure-keyvault-certificates==4.7.0
azure-keyvault-keys==4.8.0
azure-keyvault-secrets==4.7.0
azure-mgmt-apimanagement==3.0.0
azure-mgmt-authorization==2.0.0
azure-mgmt-automation==1.0.0
azure-mgmt-batch==17.3.0
azure-mgmt-cdn==13.0.0
azure-mgmt-compute==30.6.0
azure-mgmt-containerinstance==10.1.0
azure-mgmt-containerregistry==10.3.0
azure-mgmt-containerservice==29.1.0
azure-mgmt-core==1.4.0
azure-mgmt-cosmosdb==9.4.0
azure-mgmt-datafactory==6.1.0
azure-mgmt-datalake-nspkg==3.0.1
azure-mgmt-datalake-store==0.5.0
azure-mgmt-batch==16.2.0
azure-mgmt-cdn==11.0.0
azure-mgmt-compute==26.1.0
azure-mgmt-containerinstance==9.0.0
azure-mgmt-containerregistry==9.1.0
azure-mgmt-containerservice==20.0.0
azure-mgmt-core==1.3.0
azure-mgmt-cosmosdb==6.4.0
azure-mgmt-datafactory==2.0.0
azure-mgmt-datalake-store==1.0.0
azure-mgmt-devtestlabs==9.0.0
azure-mgmt-dns==8.1.0
azure-mgmt-eventhub==11.0.0
azure-mgmt-dns==8.0.0
azure-mgmt-eventhub==10.1.0
azure-mgmt-hdinsight==9.0.0
azure-mgmt-iothub==3.0.0
azure-mgmt-keyvault==10.3.0
azure-mgmt-iothub==2.2.0
azure-mgmt-keyvault==10.0.0
azure-mgmt-loganalytics==12.0.0
azure-mgmt-managedservices==6.0.0
azure-mgmt-managementgroups==1.0.0
azure-mgmt-marketplaceordering==1.1.0
azure-mgmt-monitor==6.0.2
azure-mgmt-network==25.3.0
azure-mgmt-notificationhubs==8.0.0
azure-mgmt-nspkg==3.0.2
azure-mgmt-privatedns==1.1.0
azure-mgmt-rdbms==10.1.0
azure-mgmt-recoveryservices==2.5.0
azure-mgmt-monitor==3.0.0
azure-mgmt-network==19.1.0
azure-mgmt-notificationhubs==7.0.0
azure-mgmt-nspkg==2.0.0
azure-mgmt-privatedns==1.0.0
azure-mgmt-rdbms==10.0.0
azure-mgmt-recoveryservices==2.0.0
azure-mgmt-recoveryservicesbackup==3.0.0
azure-mgmt-redis==14.3.0
azure-mgmt-resource==23.0.1
azure-mgmt-search==9.1.0
azure-mgmt-servicebus==8.2.0
azure-mgmt-redis==13.0.0
azure-mgmt-resource==21.1.0
azure-mgmt-search==8.0.0
azure-mgmt-servicebus==7.1.0
azure-mgmt-sql==3.0.1
azure-mgmt-storage==21.1.0
azure-mgmt-trafficmanager==1.1.0
azure-mgmt-web==7.2.0
azure-nspkg==3.0.2
azure-storage-blob==12.19.1
azure-mgmt-storage==19.0.0
azure-mgmt-trafficmanager==1.0.0b1
azure-mgmt-web==6.1.0
azure-nspkg==2.0.0
azure-storage-blob==12.11.0
bcrypt==4.1.2
boto3==1.34.78
botocore==1.34.78
catalystwan==0.31.2
catalystwan==0.31.1
certifi==2024.2.2
cffi==1.16.0
charset-normalizer==3.3.2
Expand All @@ -76,47 +72,27 @@ Deprecated==1.2.14
dnspython==2.6.1
flake8==7.0.0
flake8-quotes==3.4.0
frozenlist==1.4.1
h11==0.14.0
h2==4.1.0
hier-config==2.2.3
hpack==4.0.0
httpcore==1.0.5
httpx==0.27.0
humanfriendly==10.0
hyperframe==6.0.1
idna==3.6
importlib-metadata==7.0.0
isodate==0.6.1
Jinja2==3.1.3
jmespath==1.0.1
knack==0.11.0
knack==0.9.0
loguru==0.7.2
MarkupSafe==2.1.5
mccabe==0.7.0
microsoft-kiota-abstractions==1.3.2
microsoft-kiota-authentication-azure==1.0.0
microsoft-kiota-http==1.3.1
microsoft-kiota-serialization-json==1.1.0
microsoft-kiota-serialization-text==1.0.0
msal==1.28.0
msal==1.23.0
msal-extensions==0.3.1
msgraph-core==1.0.0
msgraph-sdk==1.0.0
msrest==0.7.1
msrestazure==0.6.4
multidict==6.0.5
netaddr==1.2.1
oauthlib==3.2.2
opentelemetry-api==1.24.0
opentelemetry-sdk==1.24.0
opentelemetry-semantic-conventions==0.45b0
packaging==23.2
paramiko==2.12.0
passlib==1.7.4
pendulum==3.0.0
pkginfo==1.10.0
portalocker==2.8.2
portalocker==1.7.1
psutil==5.9.8
pycodestyle==2.11.1
pycparser==2.22
Expand All @@ -137,16 +113,10 @@ requests-toolbelt==1.0.0
resolvelib==1.0.1
s3transfer==0.10.1
six==1.16.0
sniffio==1.3.1
std-uritemplate==0.0.55
tabulate==0.9.0
tenacity==8.2.3
time-machine==2.14.1
toml==0.10.2
typing_extensions==4.11.0
tzdata==2024.1
urllib3==2.2.1
wrapt==1.16.0
xmltodict==0.13.0
yarl==1.9.4
zipp==3.18.1

0 comments on commit 435d317

Please sign in to comment.