diff --git a/.ansible-lint b/.ansible-lint new file mode 100644 index 0000000..b567eb6 --- /dev/null +++ b/.ansible-lint @@ -0,0 +1,8 @@ +--- +profile: production +skip_list: + - line-length + - no-changed-when +exclude_paths: + - .venv/ + - backups/ diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..45306f4 --- /dev/null +++ b/.envrc @@ -0,0 +1,9 @@ +# Create .venv automatically if it doesn't exist +if [ ! -d .venv ]; then + python3 -m venv .venv + .venv/bin/python -m pip install -U pip setuptools wheel +fi + +# Activate the environment manually (avoids Python 3.13 deprecation warning) +export VIRTUAL_ENV=$PWD/.venv +PATH_add .venv/bin diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e1b4427 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.venv/ +*.retry +__pycache__/ +*.pyc +.DS_Store diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..e73b9ab --- /dev/null +++ b/.yamllint @@ -0,0 +1,11 @@ +--- +extends: default +rules: + line-length: disable + comments: + min-spaces-from-content: 1 + truthy: + allowed-values: ["true", "false", "yes", "no"] +ignore: | + .venv/ + backups/ diff --git a/ansible.cfg b/ansible.cfg new file mode 100644 index 0000000..c189fc8 --- /dev/null +++ b/ansible.cfg @@ -0,0 +1,19 @@ +[defaults] +inventory = inventories/prod/hosts.yml +roles_path = roles:~/.ansible/roles +collections_path = ~/.ansible/collections +host_key_checking = False +retry_files_enabled = False +interpreter_python = auto_silent +nocows = 1 +timeout = 30 +stdout_callback = yaml +bin_ansible_callbacks = True +vault_identity_list = makerfloss@~/.ansible/vault-keys/makerfloss.txt + +[persistent_connection] +command_timeout = 60 +connect_timeout = 60 + +[ssh_connection] +pipelining = True diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..3d5bd4d --- /dev/null +++ b/requirements.txt @@ -0,0 +1,10 @@ +# Core Ansible +ansible==10.3.0 + +# Linting & validation +ansible-lint==24.7.0 +yamllint==1.35.1 + +# Network connection plugins / SCP for SSH key transfer to RouterOS +paramiko>=3.4.0 +scp>=0.15.0 diff --git a/requirements.yml b/requirements.yml new file mode 100644 index 0000000..9a04f2e --- /dev/null +++ b/requirements.yml @@ -0,0 +1,6 @@ +--- +collections: + - name: community.routeros + version: ">=3.0.0,<4.0.0" + - name: ansible.netcommon + version: ">=6.0.0,<8.0.0"