{"id":16563078,"url":"https://github.com/ab77/ansible-smartdns","last_synced_at":"2026-03-16T17:32:41.408Z","repository":{"id":92447860,"uuid":"113606386","full_name":"ab77/ansible-smartdns","owner":"ab77","description":"deploy SNIProxy and/or dnsmasq with Ansible","archived":false,"fork":false,"pushed_at":"2017-12-08T18:46:35.000Z","size":18,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T20:36:23.995Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ab77.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-12-08T18:44:15.000Z","updated_at":"2021-08-08T14:52:26.000Z","dependencies_parsed_at":"2023-03-13T17:28:55.670Z","dependency_job_id":null,"html_url":"https://github.com/ab77/ansible-smartdns","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ab77/ansible-smartdns","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ab77%2Fansible-smartdns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ab77%2Fansible-smartdns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ab77%2Fansible-smartdns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ab77%2Fansible-smartdns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ab77","download_url":"https://codeload.github.com/ab77/ansible-smartdns/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ab77%2Fansible-smartdns/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271657543,"owners_count":24797934,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-22T02:00:08.480Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T20:38:37.703Z","updated_at":"2026-03-16T17:32:36.351Z","avatar_url":"https://github.com/ab77.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SmartDNS\n\n## Ansible\n\n### install on master\n```\napt-get update\\\n  \u0026\u0026 apt-get install -y --no-install-recommends git\\\n  \u0026\u0026 (git clone git@github.com:ab77/ansible-smartdns.git\\\n  || git clone https://github.com/ab77/ansible-smartdns.git)\\\n  \u0026\u0026 cd ansible-smartdns\\\n  \u0026\u0026 apt-get install -y --no-install-recommends\\\n  python-minimal python-pip python-setuptools\\\n  \u0026\u0026 pip install -r requirements.txt --upgrade\\\n  \u0026\u0026 ansible --version\n```\n\n### update master\nTo update the local repository from upstream master, run `git pull`.\n\n### configure environment\nAll of the top-level environment variables are located in `environments/000_cross_vars` (e.g.):\n\n```\n# cross environment\nansible_ssh_user: root\nresolvers:\n  - 8.8.8.8\n  - 8.8.4.4\ndnsmasq_listen_addresses:\n  - \"{{ ansible_default_ipv4.address }}\"\n  - \"{{ ansible_default_ipv6.address }}\"\nsniproxy_version: 0.5.0\nsniproxy_mode: mode ipv4_only\nbypass_sub_domains:\nproxy_domains:\n  - akadns.net\n  - akam.net\n  - akamai.com\n  - akamai.net\n  - akamaiedge.net\n...\n```\n\n### deploy\n\n#### dev\n\n##### configure hosts\n* create hosts file\n\n```\ncp environments/templates/hosts.template environments/dev/hosts\n```\n\n* populate `environments/dev/hosts` with IP addresses under relevant `[section]`\n\n* create and add IPs to `environments/dev/files/ip_whitelist.txt` (e.g.):\n```\n149.101.145.11\n121.212.175.192\n10.145.74.106\n182.34.28.163\n170.116.31.140\n```\n\n* if not using IPv6, just `touch environments/dev/files/ip6_whitelist.txt`\n\n* run playbook\n\n```\nansible-playbook site.yml --inventory-file=environments/dev/hosts\n```\n\n#### live\n\n##### configure hosts\n* create hosts file\n\n```\ncp environments/templates/hosts.template environments/live/hosts\n```\n\n* populate `environments/live/hosts` with IP addresses\n\n* create and add IPs to `environments/live/files/ip_whitelist.txt` and `ip6_whitelist.txt`\n\n* if not using IPv6, `touch environments/live/files/ip6_whitelist.txt`\n\n* run playbook\n\n```\nansible-playbook site.yml --inventory-file=environments/live/hosts\n```\n\n### environment variables override (optional)\nEnvironment variables are inherited from the top-level as follows:\n* environments/000_cross_vars\n* environments/dev/group_vars/all\n* environments/dev/group_vars/{{group}}\n* environments/dev/host_vars/{{host}}\n\nOverride environment variables at the host level as follows:\n\n* create host skeleton under `host_vars`\n\n```\ncp -r environments/templates/{{env}}/host_vars/__template__\\\n  environments/templates/{{env}}/host_vars/{{ipaddr}}\n```\n\n* add override environment variables to `vars` (e.g.):\n\n```\ndnsmasq_listen_addresses:\n  - 166.246.157.23\n  - 99.34.68.44\n  - 87.53.234.105\n```\n\n### secrets management (optional)\nSometimes it is necessary to store secrets (e.g. keys, passwords).\n\n* create or edit Ansible vault in the appropriate directory (e.g. `environments/`)\n\n```\nansible-vault edit 000_cross_vault || ansible-vault create 000_cross_vault\n\n```\n* create vault variables as follows\n\n```\nvault_my_secret: mysupersecretpassword\n```\n\n* reference secret in `vars` file as follows:\n\n```\nmy_secret: \"{{ vault_my_secret }}\"\n```\n\n* reference `my_secret` environment variable in tasks as `\"{{ my_secret }}\"`\n\n* store the vault secret password in `~/.ansible/credentials`\n\n* run playbook unattended as follows:\n\n```\nansible-playbook site.yml\\\n  --inventory-file=environments/live/hosts\\\n  --vault-password-file ~/.ansible/credentials\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fab77%2Fansible-smartdns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fab77%2Fansible-smartdns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fab77%2Fansible-smartdns/lists"}