├── .github └── workflows │ └── commitlint.yml ├── .gitignore ├── .gitlab-ci.yml ├── .hgignore ├── .pre-commit-config.yaml ├── .rstcheck.cfg ├── .rubocop.yml ├── .salt-lint ├── .travis.yml ├── .yamllint ├── AUTHORS.md ├── CHANGELOG.md ├── CODEOWNERS ├── FORMULA ├── Gemfile ├── Gemfile.lock ├── LICENSE ├── bin ├── install-hooks └── kitchen ├── commitlint.config.js ├── dhcpd ├── _mapdata │ ├── _mapdata.jinja │ └── init.sls ├── config.sls ├── defaults.yaml ├── files │ ├── dhcpd.conf │ ├── dhcpd.sample │ ├── host.jinja │ ├── service_config.Debian │ ├── service_config.FreeBSD │ ├── service_config.Gentoo │ ├── service_config.RedHat │ └── subnet.jinja ├── init.sls ├── map.jinja ├── osarchmap.yaml ├── osfamilymap.yaml ├── osfingermap.yaml └── osmap.yaml ├── docs ├── AUTHORS.rst ├── CHANGELOG.rst └── README.rst ├── kitchen.yml ├── pillar.example ├── pre-commit_semantic-release.sh ├── release-rules.js ├── release.config.js └── test └── integration ├── default ├── README.md ├── controls │ ├── _mapdata.rb │ ├── config_spec.rb │ ├── packages_spec.rb │ └── services_spec.rb ├── files │ └── _mapdata │ │ ├── amazonlinux-1.yaml │ │ ├── amazonlinux-2.yaml │ │ ├── arch-base-latest.yaml │ │ ├── centos-7.yaml │ │ ├── centos-8.yaml │ │ ├── debian-10.yaml │ │ ├── debian-11.yaml │ │ ├── debian-9.yaml │ │ ├── fedora-31.yaml │ │ ├── fedora-32.yaml │ │ ├── fedora-33.yaml │ │ ├── fedora-34.yaml │ │ ├── fedora-35.yaml │ │ ├── fedora-36.yaml │ │ ├── gentoo-2-sysd.yaml │ │ ├── gentoo-2-sysv.yaml │ │ ├── opensuse-15.yaml │ │ ├── oraclelinux-7.yaml │ │ ├── ubuntu-16.yaml │ │ ├── ubuntu-18.yaml │ │ ├── ubuntu-20.yaml │ │ └── ubuntu-22.yaml └── inspec.yml └── share ├── README.md ├── inspec.yml └── libraries └── system.rb /.github/workflows/commitlint.yml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | name: Commitlint 5 | 'on': [pull_request] 6 | 7 | jobs: 8 | lint: 9 | runs-on: ubuntu-latest 10 | env: 11 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 12 | steps: 13 | - uses: actions/checkout@v2 14 | with: 15 | fetch-depth: 0 16 | - uses: wagoid/commitlint-github-action@v1 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a packager 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | .kitchen 49 | .kitchen.local.yml 50 | kitchen.local.yml 51 | junit-*.xml 52 | 53 | # Translations 54 | *.mo 55 | *.pot 56 | 57 | # Django stuff: 58 | *.log 59 | local_settings.py 60 | 61 | # Flask stuff: 62 | instance/ 63 | .webassets-cache 64 | 65 | # Scrapy stuff: 66 | .scrapy 67 | 68 | # Sphinx documentation 69 | docs/_build/ 70 | 71 | # PyBuilder 72 | target/ 73 | 74 | # Jupyter Notebook 75 | .ipynb_checkpoints 76 | 77 | # pyenv 78 | .python-version 79 | 80 | # celery beat schedule file 81 | celerybeat-schedule 82 | 83 | # SageMath parsed files 84 | *.sage.py 85 | 86 | # dotenv 87 | .env 88 | 89 | # virtualenv 90 | .venv 91 | venv/ 92 | ENV/ 93 | 94 | # visual studio 95 | .vs/ 96 | 97 | # Spyder project settings 98 | .spyderproject 99 | .spyproject 100 | 101 | # Rope project settings 102 | .ropeproject 103 | 104 | # mkdocs documentation 105 | /site 106 | 107 | # mypy 108 | .mypy_cache/ 109 | 110 | # Bundler 111 | .bundle/ 112 | 113 | # copied `.md` files used for conversion to `.rst` using `m2r` 114 | docs/*.md 115 | 116 | # Vim 117 | *.sw? 118 | 119 | ## Collected when centralising formulas (check and sort) 120 | # `collectd-formula` 121 | .pytest_cache/ 122 | /.idea/ 123 | Dockerfile.*_* 124 | ignore/ 125 | tmp/ 126 | 127 | # `salt-formula` -- Vagrant Specific files 128 | .vagrant 129 | top.sls 130 | !test/salt/pillar/top.sls 131 | 132 | # `suricata-formula` -- Platform binaries 133 | *.rpm 134 | *.deb 135 | -------------------------------------------------------------------------------- /.hgignore: -------------------------------------------------------------------------------- 1 | \..*\.swp 2 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | # See https://pre-commit.com for more information 5 | # See https://pre-commit.com/hooks.html for more hooks 6 | ci: 7 | autofix_commit_msg: | 8 | ci(pre-commit.ci): apply auto fixes from pre-commit.com hooks 9 | 10 | For more information, see https://pre-commit.ci 11 | autofix_prs: true 12 | autoupdate_branch: '' 13 | autoupdate_commit_msg: | 14 | ci(pre-commit.ci): perform `pre-commit` autoupdate 15 | autoupdate_schedule: quarterly 16 | skip: [] 17 | submodules: false 18 | default_stages: [commit] 19 | repos: 20 | - repo: https://github.com/dafyddj/commitlint-pre-commit-hook 21 | rev: v2.3.0 22 | hooks: 23 | - id: commitlint 24 | name: Check commit message using commitlint 25 | description: Lint commit message against @commitlint/config-conventional rules 26 | stages: [commit-msg] 27 | additional_dependencies: ['@commitlint/config-conventional@8.3.4'] 28 | - id: commitlint-travis 29 | stages: [manual] 30 | additional_dependencies: ['@commitlint/config-conventional@8.3.4'] 31 | always_run: true 32 | - repo: https://github.com/rubocop-hq/rubocop 33 | rev: v1.30.1 34 | hooks: 35 | - id: rubocop 36 | name: Check Ruby files with rubocop 37 | args: [--debug] 38 | always_run: true 39 | pass_filenames: false 40 | - repo: https://github.com/shellcheck-py/shellcheck-py 41 | rev: v0.8.0.4 42 | hooks: 43 | - id: shellcheck 44 | name: Check shell scripts with shellcheck 45 | files: ^.*\.(sh|bash|ksh)$ 46 | types: [] 47 | - repo: https://github.com/adrienverge/yamllint 48 | rev: v1.26.3 49 | hooks: 50 | - id: yamllint 51 | name: Check YAML syntax with yamllint 52 | args: [--strict, '.'] 53 | always_run: true 54 | pass_filenames: false 55 | - repo: https://github.com/warpnet/salt-lint 56 | rev: v0.8.0 57 | hooks: 58 | - id: salt-lint 59 | name: Check Salt files using salt-lint 60 | files: ^.*\.(sls|jinja|j2|tmpl|tst)$ 61 | - repo: https://github.com/myint/rstcheck 62 | rev: 3f929574 63 | hooks: 64 | - id: rstcheck 65 | name: Check reST files using rstcheck 66 | exclude: 'docs/CHANGELOG.rst' 67 | - repo: https://github.com/saltstack-formulas/mirrors-rst-lint 68 | rev: v1.3.2 69 | hooks: 70 | - id: rst-lint 71 | name: Check reST files using rst-lint 72 | exclude: | 73 | (?x)^( 74 | docs/CHANGELOG.rst| 75 | docs/TOFS_pattern.rst| 76 | )$ 77 | additional_dependencies: [pygments==2.9.0] 78 | -------------------------------------------------------------------------------- /.rstcheck.cfg: -------------------------------------------------------------------------------- 1 | [rstcheck] 2 | report=info 3 | ignore_language=rst 4 | ignore_messages=(Duplicate (ex|im)plicit target.*|Hyperlink target ".*" is not referenced\.$) 5 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | # General overrides used across formulas in the org 5 | Layout/LineLength: 6 | # Increase from default of `80` 7 | # Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`) 8 | Max: 88 9 | Metrics/BlockLength: 10 | IgnoredMethods: 11 | - control 12 | - describe 13 | # Increase from default of `25` 14 | Max: 30 15 | Security/YAMLLoad: 16 | Exclude: 17 | - test/integration/**/_mapdata.rb 18 | 19 | # General settings across all cops in this formula 20 | AllCops: 21 | NewCops: enable 22 | 23 | # Any offenses that should be fixed, e.g. collected via. `rubocop --auto-gen-config` 24 | -------------------------------------------------------------------------------- /.salt-lint: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | exclude_paths: [] 5 | rules: {} 6 | skip_list: 7 | # Using `salt-lint` for linting other files as well, such as Jinja macros/templates 8 | - 205 # Use ".sls" as a Salt State file extension 9 | # Skipping `207` and `208` because `210` is sufficient, at least for the time-being 10 | # I.e. Allows 3-digit unquoted codes to still be used, such as `644` and `755` 11 | - 207 # File modes should always be encapsulated in quotation marks 12 | - 208 # File modes should always contain a leading zero 13 | tags: [] 14 | verbosity: 1 15 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | ################################################################################ 5 | # NOTE: This file is UNMAINTAINED; it is provided for references purposes only. 6 | # No guarantees are tendered that this structure will work after 2020. 7 | ################################################################################ 8 | # * https://en.wikipedia.org/wiki/Travis_CI: 9 | # - "... free open-source plans were removed in [sic] the end of 2020" 10 | # - https://blog.travis-ci.com/2020-11-02-travis-ci-new-billing 11 | # - https://ropensci.org/technotes/2020/11/19/moving-away-travis/ 12 | ################################################################################ 13 | ## Machine config 14 | os: 'linux' 15 | arch: 'amd64' 16 | dist: 'bionic' 17 | version: '~> 1.0' 18 | 19 | ## Language and cache config 20 | language: 'ruby' 21 | cache: 'bundler' 22 | 23 | ## Services config 24 | services: 25 | - docker 26 | 27 | ## Script to run for the test stage 28 | script: 29 | - bin/kitchen verify "${INSTANCE}" 30 | 31 | ## Stages and jobs matrix 32 | stages: 33 | - test 34 | # # As part of the switch away from Travis CI, ensure that the `release` stage 35 | # # is not run inadvertently 36 | # - name: 'release' 37 | # if: 'branch = master AND type != pull_request' 38 | jobs: 39 | include: 40 | ## Define the test stage that runs the linters (and testing matrix, if applicable) 41 | 42 | # Run all of the linters in a single job 43 | - language: 'node_js' 44 | node_js: 'lts/*' 45 | env: 'Lint' 46 | name: 'Lint: salt-lint, yamllint, rubocop, shellcheck & commitlint' 47 | before_install: 'skip' 48 | script: 49 | # Install and run `salt-lint` 50 | - pip install --user salt-lint 51 | - git ls-files -- '*.sls' '*.jinja' '*.j2' '*.tmpl' '*.tst' 52 | | xargs salt-lint 53 | # Install and run `yamllint` 54 | # Need at least `v1.17.0` for the `yaml-files` setting 55 | - pip install --user yamllint>=1.17.0 56 | - yamllint -s . 57 | # Install and run `rubocop` 58 | - gem install rubocop 59 | - rubocop -d 60 | # Run `shellcheck` (already pre-installed in Travis) 61 | - shellcheck --version 62 | - git ls-files -- '*.sh' '*.bash' '*.ksh' 63 | | xargs shellcheck 64 | # Install and run `commitlint` 65 | - npm i -D @commitlint/config-conventional 66 | @commitlint/travis-cli 67 | - commitlint-travis 68 | 69 | # Run `pre-commit` linters in a single job 70 | - language: 'python' 71 | env: 'Lint_pre-commit' 72 | name: 'Lint: pre-commit' 73 | before_install: 'skip' 74 | cache: 75 | directories: 76 | - $HOME/.cache/pre-commit 77 | script: 78 | # Install and run `pre-commit` 79 | - pip install pre-commit==2.7.1 80 | - pre-commit run --all-files --color always --verbose 81 | - pre-commit run --color always --hook-stage manual --verbose commitlint-travis 82 | 83 | ## Define the rest of the matrix based on Kitchen testing 84 | # Make sure the instances listed below match up with 85 | # the `platforms` defined in `kitchen.yml` 86 | # - env: INSTANCE=default-debian-11-tiamat-py3 87 | # - env: INSTANCE=default-debian-10-tiamat-py3 88 | # - env: INSTANCE=default-debian-9-tiamat-py3 89 | # - env: INSTANCE=default-ubuntu-2204-tiamat-py3 90 | # - env: INSTANCE=default-ubuntu-2004-tiamat-py3 91 | # - env: INSTANCE=default-ubuntu-1804-tiamat-py3 92 | # - env: INSTANCE=default-centos-stream8-tiamat-py3 93 | # - env: INSTANCE=default-centos-7-tiamat-py3 94 | # - env: INSTANCE=default-amazonlinux-2-tiamat-py3 95 | # - env: INSTANCE=default-oraclelinux-8-tiamat-py3 96 | # - env: INSTANCE=default-oraclelinux-7-tiamat-py3 97 | # - env: INSTANCE=default-almalinux-8-tiamat-py3 98 | # - env: INSTANCE=default-rockylinux-8-tiamat-py3 99 | - env: INSTANCE=default-debian-11-master-py3 100 | - env: INSTANCE=default-debian-10-master-py3 101 | - env: INSTANCE=default-debian-9-master-py3 102 | - env: INSTANCE=default-ubuntu-2204-master-py3 103 | - env: INSTANCE=default-ubuntu-2004-master-py3 104 | - env: INSTANCE=default-ubuntu-1804-master-py3 105 | # - env: INSTANCE=default-centos-stream8-master-py3 106 | - env: INSTANCE=default-centos-7-master-py3 107 | - env: INSTANCE=default-fedora-36-master-py3 108 | - env: INSTANCE=default-fedora-35-master-py3 109 | - env: INSTANCE=default-opensuse-leap-153-master-py3 110 | # - env: INSTANCE=default-opensuse-tmbl-latest-master-py3 111 | - env: INSTANCE=default-amazonlinux-2-master-py3 112 | # - env: INSTANCE=default-oraclelinux-8-master-py3 113 | - env: INSTANCE=default-oraclelinux-7-master-py3 114 | - env: INSTANCE=default-arch-base-latest-master-py3 115 | - env: INSTANCE=default-gentoo-stage3-latest-master-py3 116 | - env: INSTANCE=default-gentoo-stage3-systemd-master-py3 117 | # - env: INSTANCE=default-almalinux-8-master-py3 118 | # - env: INSTANCE=default-rockylinux-8-master-py3 119 | # - env: INSTANCE=default-debian-11-3004-1-py3 120 | # - env: INSTANCE=default-debian-10-3004-1-py3 121 | # - env: INSTANCE=default-debian-9-3004-1-py3 122 | # - env: INSTANCE=default-ubuntu-2204-3004-1-py3 123 | # - env: INSTANCE=default-ubuntu-2004-3004-1-py3 124 | # - env: INSTANCE=default-ubuntu-1804-3004-1-py3 125 | # - env: INSTANCE=default-centos-stream8-3004-1-py3 126 | # - env: INSTANCE=default-centos-7-3004-1-py3 127 | # - env: INSTANCE=default-fedora-36-3004-1-py3 128 | # - env: INSTANCE=default-fedora-35-3004-1-py3 129 | # - env: INSTANCE=default-amazonlinux-2-3004-1-py3 130 | # - env: INSTANCE=default-oraclelinux-8-3004-1-py3 131 | # - env: INSTANCE=default-oraclelinux-7-3004-1-py3 132 | # - env: INSTANCE=default-arch-base-latest-3004-1-py3 133 | # - env: INSTANCE=default-gentoo-stage3-latest-3004-1-py3 134 | # - env: INSTANCE=default-gentoo-stage3-systemd-3004-1-py3 135 | # - env: INSTANCE=default-almalinux-8-3004-1-py3 136 | # - env: INSTANCE=default-rockylinux-8-3004-1-py3 137 | # - env: INSTANCE=default-opensuse-leap-153-3004-0-py3 138 | # - env: INSTANCE=default-opensuse-tmbl-latest-3004-0-py3 139 | # - env: INSTANCE=default-debian-10-3003-4-py3 140 | # - env: INSTANCE=default-debian-9-3003-4-py3 141 | # - env: INSTANCE=default-ubuntu-2004-3003-4-py3 142 | # - env: INSTANCE=default-ubuntu-1804-3003-4-py3 143 | # - env: INSTANCE=default-centos-stream8-3003-4-py3 144 | # - env: INSTANCE=default-centos-7-3003-4-py3 145 | # - env: INSTANCE=default-amazonlinux-2-3003-4-py3 146 | # - env: INSTANCE=default-oraclelinux-8-3003-4-py3 147 | # - env: INSTANCE=default-oraclelinux-7-3003-4-py3 148 | # - env: INSTANCE=default-almalinux-8-3003-4-py3 149 | 150 | ## Define the release stage that runs `semantic-release` 151 | - stage: 'release' 152 | language: 'node_js' 153 | node_js: 'lts/*' 154 | env: 'Release' 155 | name: 'Run semantic-release inc. file updates to AUTHORS, CHANGELOG & FORMULA' 156 | before_install: 'skip' 157 | script: 158 | # Update `AUTHORS.md` 159 | - export MAINTAINER_TOKEN=${GH_TOKEN} 160 | - go get github.com/myii/maintainer 161 | - maintainer contributor 162 | 163 | # Install all dependencies required for `semantic-release` 164 | - npm i -D @semantic-release/changelog@3 165 | @semantic-release/exec@3 166 | @semantic-release/git@7 167 | deploy: 168 | provider: 'script' 169 | # Opt-in to `dpl v2` to complete the Travis build config validation (beta) 170 | # * https://docs.travis-ci.com/user/build-config-validation 171 | # Deprecated `skip_cleanup` can now be avoided, `cleanup: false` is by default 172 | edge: true 173 | # Run `semantic-release` 174 | script: 'npx semantic-release@15.14' 175 | 176 | # Notification options: `always`, `never` or `change` 177 | notifications: 178 | webhooks: 179 | if: 'repo = saltstack-formulas/dhcpd-formula' 180 | urls: 181 | - https://saltstack-formulas.zulipchat.com/api/v1/external/travis?api_key=HsIq3o5QmLxdnVCKF9is0FUIpkpAY79P&stream=CI&topic=saltstack-formulas%2Fdhcpd-formula&ignore_pull_requests=true 182 | on_success: always # default: always 183 | on_failure: always # default: always 184 | on_start: always # default: never 185 | on_cancel: always # default: always 186 | on_error: always # default: always 187 | -------------------------------------------------------------------------------- /.yamllint: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | # Extend the `default` configuration provided by `yamllint` 5 | extends: 'default' 6 | 7 | # Files to ignore completely 8 | # 1. All YAML files under directory `.bundle/`, introduced if gems are installed locally 9 | # 2. All YAML files under directory `.cache/`, introduced during the CI run 10 | # 3. All YAML files under directory `.git/` 11 | # 4. All YAML files under directory `node_modules/`, introduced during the CI run 12 | # 5. Any SLS files under directory `test/`, which are actually state files 13 | # 6. Any YAML files under directory `.kitchen/`, introduced during local testing 14 | # 7. `kitchen.vagrant.yml`, which contains Embedded Ruby (ERB) template syntax 15 | ignore: | 16 | .bundle/ 17 | .cache/ 18 | .git/ 19 | node_modules/ 20 | test/**/states/**/*.sls 21 | .kitchen/ 22 | kitchen.vagrant.yml 23 | 24 | yaml-files: 25 | # Default settings 26 | - '*.yaml' 27 | - '*.yml' 28 | - .salt-lint 29 | - .yamllint 30 | # SaltStack Formulas additional settings 31 | - '*.example' 32 | - test/**/*.sls 33 | 34 | rules: 35 | empty-values: 36 | forbid-in-block-mappings: true 37 | forbid-in-flow-mappings: true 38 | line-length: 39 | # Increase from default of `80` 40 | # Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`) 41 | max: 88 42 | octal-values: 43 | forbid-implicit-octal: true 44 | forbid-explicit-octal: true 45 | -------------------------------------------------------------------------------- /AUTHORS.md: -------------------------------------------------------------------------------- 1 | # Authors 2 | 3 | This list is sorted by the number of commits per contributor in _descending_ order. 4 | 5 | Avatar|Contributor|Contributions 6 | :-:|---|:-: 7 | @myii|[@myii](https://github.com/myii)|130 8 | @baby-gnu|[@baby-gnu](https://github.com/baby-gnu)|14 9 | @aboe76|[@aboe76](https://github.com/aboe76)|11 10 | @0xf10e|[@0xf10e](https://github.com/0xf10e)|10 11 | @gravyboat|[@gravyboat](https://github.com/gravyboat)|10 12 | @nmadhok|[@nmadhok](https://github.com/nmadhok)|6 13 | @tampakrap|[@tampakrap](https://github.com/tampakrap)|5 14 | @kiwiz|[@kiwiz](https://github.com/kiwiz)|5 15 | @aaannz|[@aaannz](https://github.com/aaannz)|4 16 | @ukretschmer|[@ukretschmer](https://github.com/ukretschmer)|4 17 | @daschatten|[@daschatten](https://github.com/daschatten)|4 18 | @dafyddj|[@dafyddj](https://github.com/dafyddj)|3 19 | @techhat|[@techhat](https://github.com/techhat)|3 20 | @thatch45|[@thatch45](https://github.com/thatch45)|3 21 | @sticky-note|[@sticky-note](https://github.com/sticky-note)|3 22 | @stp-ip|[@stp-ip](https://github.com/stp-ip)|2 23 | @skylerberg|[@skylerberg](https://github.com/skylerberg)|2 24 | @ixs|[@ixs](https://github.com/ixs)|1 25 | @word|[@word](https://github.com/word)|1 26 | @bmwiedemann|[@bmwiedemann](https://github.com/bmwiedemann)|1 27 | @javierbertoli|[@javierbertoli](https://github.com/javierbertoli)|1 28 | @mthibaut|[@mthibaut](https://github.com/mthibaut)|1 29 | @mgomersbach|[@mgomersbach](https://github.com/mgomersbach)|1 30 | @robinelfrink|[@robinelfrink](https://github.com/robinelfrink)|1 31 | 32 | --- 33 | 34 | Auto-generated by a [forked version](https://github.com/myii/maintainer) of [gaocegege/maintainer](https://github.com/gaocegege/maintainer) on 2021-10-20. 35 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | # https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners 2 | 3 | # SECTION: Owner(s) for everything in the repo, unless a later match takes precedence 4 | # FILE PATTERN OWNER(S) 5 | * @sticky-note 6 | 7 | # SECTION: Owner(s) for specific directories 8 | # FILE PATTERN OWNER(S) 9 | 10 | # SECTION: Owner(s) for files/directories related to `semantic-release` 11 | # FILE PATTERN OWNER(S) 12 | /.github/workflows/ @saltstack-formulas/ssf 13 | /bin/install-hooks @saltstack-formulas/ssf 14 | /bin/kitchen @saltstack-formulas/ssf 15 | /docs/AUTHORS.rst @saltstack-formulas/ssf 16 | /docs/CHANGELOG.rst @saltstack-formulas/ssf 17 | /docs/TOFS_pattern.rst @saltstack-formulas/ssf 18 | /*/_mapdata/ @saltstack-formulas/ssf 19 | /*/libsaltcli.jinja @saltstack-formulas/ssf 20 | /*/libtofs.jinja @saltstack-formulas/ssf 21 | /test/integration/**/_mapdata.rb @saltstack-formulas/ssf 22 | /test/integration/**/libraries/system.rb @saltstack-formulas/ssf 23 | /test/integration/**/inspec.yml @saltstack-formulas/ssf 24 | /test/integration/**/README.md @saltstack-formulas/ssf 25 | /test/salt/pillar/top.sls @saltstack-formulas/ssf 26 | /.gitignore @saltstack-formulas/ssf 27 | /.cirrus.yml @saltstack-formulas/ssf 28 | /.gitlab-ci.yml @saltstack-formulas/ssf 29 | /.pre-commit-config.yaml @saltstack-formulas/ssf 30 | /.rstcheck.cfg @saltstack-formulas/ssf 31 | /.rubocop.yml @saltstack-formulas/ssf 32 | /.salt-lint @saltstack-formulas/ssf 33 | /.travis.yml @saltstack-formulas/ssf 34 | /.yamllint @saltstack-formulas/ssf 35 | /AUTHORS.md @saltstack-formulas/ssf 36 | /CHANGELOG.md @saltstack-formulas/ssf 37 | /CODEOWNERS @saltstack-formulas/ssf 38 | /commitlint.config.js @saltstack-formulas/ssf 39 | /FORMULA @saltstack-formulas/ssf 40 | /Gemfile @saltstack-formulas/ssf 41 | /Gemfile.lock @saltstack-formulas/ssf 42 | /kitchen.yml @saltstack-formulas/ssf 43 | /kitchen.vagrant.yml @saltstack-formulas/ssf 44 | /kitchen.windows.yml @saltstack-formulas/ssf 45 | /pre-commit_semantic-release.sh @saltstack-formulas/ssf 46 | /release-rules.js @saltstack-formulas/ssf 47 | /release.config.js @saltstack-formulas/ssf 48 | 49 | # SECTION: Owner(s) for specific files 50 | # FILE PATTERN OWNER(S) 51 | -------------------------------------------------------------------------------- /FORMULA: -------------------------------------------------------------------------------- 1 | name: dhcpd 2 | os: Debian, Ubuntu, Raspbian, RedHat, CentOS, Arch, FreeBSD 3 | os_family: Debian, RedHat, Arch, FreeBSD 4 | version: 0.11.5 5 | release: 1 6 | minimum_version: 2016.11 7 | summary: DHCPD formula 8 | description: Formula to install, configure and start dhcpd 9 | top_level_dir: dhcpd 10 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | source ENV.fetch('PROXY_RUBYGEMSORG', 'https://rubygems.org') 4 | 5 | # Install the `inspec` gem using `git` because versions after `4.22.22` 6 | # suppress diff output; this version fixes this for our uses. 7 | # rubocop:disable Layout/LineLength 8 | gem 'inspec', git: 'https://gitlab.com/saltstack-formulas/infrastructure/inspec', branch: 'ssf' 9 | # rubocop:enable Layout/LineLength 10 | 11 | # Install the `kitchen-docker` gem using `git` in order to gain a performance 12 | # improvement: avoid package installations which are already covered by the 13 | # `salt-image-builder` (i.e. the pre-salted images that we're using) 14 | # rubocop:disable Layout/LineLength 15 | gem 'kitchen-docker', git: 'https://gitlab.com/saltstack-formulas/infrastructure/kitchen-docker', branch: 'ssf' 16 | # rubocop:enable Layout/LineLength 17 | 18 | gem 'kitchen-inspec', '>= 2.5.0' 19 | gem 'kitchen-salt', '>= 0.7.2' 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2015 Salt Stack Formulas 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /bin/install-hooks: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | set -o nounset # Treat unset variables as an error and immediately exit 3 | set -o errexit # If a command fails exit the whole script 4 | 5 | if [ "${DEBUG:-false}" = "true" ]; then 6 | set -x # Run the entire script in debug mode 7 | fi 8 | 9 | if ! command -v pre-commit >/dev/null 2>&1; then 10 | echo "pre-commit not found: please install or check your PATH" >&2 11 | echo "See https://pre-commit.com/#installation" >&2 12 | exit 1 13 | fi 14 | 15 | pre-commit install --install-hooks 16 | pre-commit install --hook-type commit-msg --install-hooks 17 | -------------------------------------------------------------------------------- /bin/kitchen: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | 4 | # 5 | # This file was generated by Bundler. 6 | # 7 | # The application 'kitchen' is installed as part of a gem, and 8 | # this file is here to facilitate running it. 9 | # 10 | 11 | require 'pathname' 12 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', 13 | Pathname.new(__FILE__).realpath) 14 | 15 | bundle_binstub = File.expand_path('bundle', __dir__) 16 | 17 | if File.file?(bundle_binstub) 18 | if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ 19 | load(bundle_binstub) 20 | else 21 | abort( 22 | 'Your `bin/bundle` was not generated by Bundler, ' \ 23 | 'so this binstub cannot run. Replace `bin/bundle` by running ' \ 24 | '`bundle binstubs bundler --force`, then run this command again.' 25 | ) 26 | end 27 | end 28 | 29 | require 'rubygems' 30 | require 'bundler/setup' 31 | 32 | load Gem.bin_path('test-kitchen', 'kitchen') 33 | -------------------------------------------------------------------------------- /commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['@commitlint/config-conventional'], 3 | rules: { 4 | 'body-max-line-length': [2, 'always', 120], 5 | 'footer-max-line-length': [2, 'always', 120], 6 | 'header-max-length': [2, 'always', 72], 7 | }, 8 | }; 9 | -------------------------------------------------------------------------------- /dhcpd/_mapdata/_mapdata.jinja: -------------------------------------------------------------------------------- 1 | # yamllint disable rule:indentation rule:line-length 2 | # {{ grains.get("osfinger", grains.os) }} 3 | --- 4 | {#- use salt.slsutil.serialize to avoid encoding errors on some platforms #} 5 | {{ salt["slsutil.serialize"]( 6 | "yaml", 7 | map, 8 | default_flow_style=False, 9 | allow_unicode=True, 10 | ) 11 | | regex_replace("^\s+'$", "'", multiline=True) 12 | | trim 13 | }} 14 | -------------------------------------------------------------------------------- /dhcpd/_mapdata/init.sls: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=sls 3 | --- 4 | {#- Get the `tplroot` from `tpldir` #} 5 | {%- set tplroot = tpldir.split("/")[0] %} 6 | {%- from tplroot ~ "/map.jinja" import dhcpd with context %} 7 | 8 | {%- set _mapdata = { 9 | "values": dhcpd, 10 | } %} 11 | {%- do salt["log.debug"]("### MAP.JINJA DUMP ###\n" ~ _mapdata | yaml(False)) %} 12 | 13 | {%- set output_dir = "/temp" if grains.os_family == "Windows" else "/tmp" %} 14 | {%- set output_file = output_dir ~ "/salt_mapdata_dump.yaml" %} 15 | 16 | {{ tplroot }}-mapdata-dump: 17 | file.managed: 18 | - name: {{ output_file }} 19 | - source: salt://{{ tplroot }}/_mapdata/_mapdata.jinja 20 | - template: jinja 21 | - context: 22 | map: {{ _mapdata | yaml }} 23 | -------------------------------------------------------------------------------- /dhcpd/config.sls: -------------------------------------------------------------------------------- 1 | {#- Get the `tplroot` from `tpldir` #} 2 | {%- set tplroot = tpldir.split('/')[0] %} 3 | 4 | {% from tplroot ~ "/map.jinja" import dhcpd with context %} 5 | 6 | include: 7 | - dhcpd 8 | 9 | dhcpd.conf: 10 | file.managed: 11 | - name: {{ dhcpd.config }} 12 | - source: salt://dhcpd/files/dhcpd.conf 13 | # apparmor limits dhcpd to its config dir, so copy the file there 14 | - check_cmd: | 15 | sh -c ' 16 | export TMPDIR=$(dirname "{{ dhcpd.config }}") ; 17 | TMPFILE="$(mktemp)" ; 18 | cp "$0" "${TMPFILE}" ; 19 | dhcpd -t -cf "${TMPFILE}" ; 20 | ERROR="$?" ; 21 | rm -f "${TMPFILE}" ; 22 | exit $ERROR ' 23 | - template: jinja 24 | - user: root 25 | {% if 'BSD' in salt['grains.get']('os') %} 26 | - group: wheel 27 | {% else %} 28 | - group: root 29 | {% endif %} 30 | - mode: 644 31 | - watch_in: 32 | - service: dhcpd 33 | - context: 34 | dhcpd: {{ dhcpd | json }} 35 | 36 | {% if dhcpd.service_config is defined %} 37 | 38 | service_config: 39 | file.managed: 40 | - name: {{ dhcpd.service_config }} 41 | - source: {{ 'salt://dhcpd/files/service_config.' ~ salt['grains.get']('os_family') }} 42 | - makedirs: True 43 | - template: jinja 44 | - user: root 45 | {% if 'BSD' in salt['grains.get']('os') %} 46 | - group: wheel 47 | {% else %} 48 | - group: root 49 | {% endif %} 50 | - mode: 644 51 | - watch_in: 52 | - service: dhcpd 53 | - context: 54 | dhcpd: {{ dhcpd | json }} 55 | 56 | {% endif %} 57 | -------------------------------------------------------------------------------- /dhcpd/defaults.yaml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | dhcpd: 5 | listen_interfaces: [] 6 | domain_name: '' 7 | domain_name_servers: [] 8 | subnet_mask: '' 9 | routers: [] 10 | domain_search: [] 11 | default_lease_time: 0 12 | max_lease_time: 0 13 | one_lease_per_client: '' 14 | get_lease_hostnames: '' 15 | server_identifier: '' 16 | server_name: '' 17 | use_host_decl_names: false 18 | allow: [] 19 | deny: [] 20 | ldap_server: '' 21 | ldap_port: '' 22 | ldap_username: '' 23 | ldap_password: '' 24 | ldap_base_dn: '' 25 | ldap_method: '' 26 | ldap_debug_file: '' 27 | ldap_init_retry: 0 28 | ldap_ssl: '' 29 | ldap_tls_reqcert: '' 30 | ldap_tls_ca_file: '' 31 | ldap_tls_ca_dir: '' 32 | ldap_tls_cert: '' 33 | ldap_tls_key: '' 34 | ldap_tls_crlcheck: '' 35 | ldap_tls_ciphers: '' 36 | ldap_tls_randfile: '' 37 | ddns_update_style: '' 38 | ddns_rev_domainname: '' 39 | ddns_domainname: '' 40 | update_static_leases: false 41 | authoritative: false 42 | log_facility: '' 43 | classes: {} 44 | failover_peers: {} 45 | keys: {} 46 | zones: {} 47 | subnets: {} 48 | hosts: {} 49 | shared_networks: {} 50 | customized_options: {} 51 | -------------------------------------------------------------------------------- /dhcpd/files/dhcpd.sample: -------------------------------------------------------------------------------- 1 | # dhcpd.conf 2 | # 3 | # Sample configuration file for ISC dhcpd 4 | # 5 | 6 | # option definitions common to all supported networks... 7 | option domain-name "example.org"; 8 | option domain-name-servers ns1.example.org, ns2.example.org; 9 | 10 | default-lease-time 600; 11 | max-lease-time 7200; 12 | 13 | # Use this to enble / disable dynamic dns updates globally. 14 | #ddns-update-style none; 15 | 16 | # If this DHCP server is the official DHCP server for the local 17 | # network, the authoritative directive should be uncommented. 18 | #authoritative; 19 | 20 | # Use this to send dhcp log messages to a different log file (you also 21 | # have to hack syslog.conf to complete the redirection). 22 | log-facility local7; 23 | 24 | # No service will be given on this subnet, but declaring it helps the 25 | # DHCP server to understand the network topology. 26 | 27 | subnet 10.152.187.0 netmask 255.255.255.0 { 28 | } 29 | 30 | # This is a very basic subnet declaration. 31 | 32 | subnet 10.254.239.0 netmask 255.255.255.224 { 33 | range 10.254.239.10 10.254.239.20; 34 | option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org; 35 | } 36 | 37 | # This declaration allows BOOTP clients to get dynamic addresses, 38 | # which we don't really recommend. 39 | 40 | subnet 10.254.239.32 netmask 255.255.255.224 { 41 | range dynamic-bootp 10.254.239.40 10.254.239.60; 42 | option broadcast-address 10.254.239.31; 43 | option routers rtr-239-32-1.example.org; 44 | } 45 | 46 | # A slightly different configuration for an internal subnet. 47 | subnet 10.5.5.0 netmask 255.255.255.224 { 48 | range 10.5.5.26 10.5.5.30; 49 | option domain-name-servers ns1.internal.example.org; 50 | option domain-name "internal.example.org"; 51 | option routers 10.5.5.1; 52 | option broadcast-address 10.5.5.31; 53 | default-lease-time 600; 54 | max-lease-time 7200; 55 | } 56 | 57 | # Hosts which require special configuration options can be listed in 58 | # host statements. If no address is specified, the address will be 59 | # allocated dynamically (if possible), but the host-specific information 60 | # will still come from the host declaration. 61 | 62 | host passacaglia { 63 | hardware ethernet 0:0:c0:5d:bd:95; 64 | filename "vmunix.passacaglia"; 65 | server-name "toccata.fugue.com"; 66 | } 67 | 68 | # Fixed IP addresses can also be specified for hosts. These addresses 69 | # should not also be listed as being available for dynamic assignment. 70 | # Hosts for which fixed IP addresses have been specified can boot using 71 | # BOOTP or DHCP. Hosts for which no fixed address is specified can only 72 | # be booted with DHCP, unless there is an address range on the subnet 73 | # to which a BOOTP client is connected which has the dynamic-bootp flag 74 | # set. 75 | host fantasia { 76 | hardware ethernet 08:00:07:26:c0:a5; 77 | fixed-address fantasia.fugue.com; 78 | } 79 | 80 | # You can declare a class of clients and then do address allocation 81 | # based on that. The example below shows a case where all clients 82 | # in a certain class get addresses on the 10.17.224/24 subnet, and all 83 | # other clients get addresses on the 10.0.29/24 subnet. 84 | 85 | class "foo" { 86 | match if substring (option vendor-class-identifier, 0, 4) = "SUNW"; 87 | } 88 | 89 | shared-network 224-29 { 90 | subnet 10.17.224.0 netmask 255.255.255.0 { 91 | option routers rtr-224.example.org; 92 | } 93 | subnet 10.0.29.0 netmask 255.255.255.0 { 94 | option routers rtr-29.example.org; 95 | } 96 | pool { 97 | allow members of "foo"; 98 | range 10.17.224.10 10.17.224.250; 99 | } 100 | pool { 101 | deny members of "foo"; 102 | range 10.0.29.10 10.0.29.230; 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /dhcpd/files/host.jinja: -------------------------------------------------------------------------------- 1 | {%- if 'comment' in config %} 2 | {%- for line in config.comment.splitlines() %} 3 | # {{ line }} 4 | {%- endfor %} 5 | {%- endif %} 6 | host {{ host }} { 7 | {%- if 'allow' in config %} 8 | {%- if config.allow is iterable and config.allow is not string %} 9 | {%- for item in config.allow %} 10 | allow {{ item }}; 11 | {%- endfor %} 12 | {%- else %} 13 | allow {{ config.allow }}; 14 | {%- endif %} 15 | {%- endif %} 16 | {%- if 'deny' in config %} 17 | {%- if config.deny is iterable and config.deny is not string %} 18 | {%- for item in config.deny %} 19 | deny {{ item }}; 20 | {%- endfor %} 21 | {%- else %} 22 | deny {{ config.deny }}; 23 | {%- endif %} 24 | {%- endif %} 25 | {%- if 'hardware' in config %} 26 | hardware {{ config.hardware }}; 27 | {%- endif %} 28 | {%- if 'ddns_hostname' in config %} 29 | ddns-hostname "{{ config.ddns_hostname }}"; 30 | {%- endif %} 31 | {%- if 'fixed_address' in config %} 32 | fixed-address {{ config.fixed_address }}; 33 | {%- endif %} 34 | {%- if 'filename' in config %} 35 | filename "{{ config.filename }}"; 36 | {%- endif %} 37 | {%- if 'next_server' in config %} 38 | next-server {{ config.next_server }}; 39 | {%- endif %} 40 | {%- if 'server_name' in config %} 41 | server-name "{{ config.server_name }}"; 42 | {%- endif %} 43 | {%- if 'host_name' in config %} 44 | option host-name "{{ config.host_name }}"; 45 | {%- endif %} 46 | {%- for option in dhcpd.customized_options.keys() %} 47 | {%- if option in config %} 48 | {%- if dhcpd.customized_options[option]['type'] in types_to_quote %} {% set quote = dquote %} {%- endif %} 49 | option {{ option|replace('_', '-') }} {{ quote }}{{ config.get(option) }}{{ quote }}; 50 | {%- endif %} 51 | {%- endfor %} 52 | } 53 | -------------------------------------------------------------------------------- /dhcpd/files/service_config.Debian: -------------------------------------------------------------------------------- 1 | # SaltStack-generated demon configuration file for ISC dhcpd 2 | 3 | # Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf). 4 | #DHCPD_CONF=/etc/dhcp/dhcpd.conf 5 | 6 | # Path to dhcpd's PID file (default: /var/run/dhcpd.pid). 7 | #DHCPD_PID=/var/run/dhcpd.pid 8 | 9 | # Additional options to start dhcpd with. 10 | # Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead 11 | #OPTIONS="" 12 | 13 | # On what interfaces should the DHCP server (dhcpd) serve DHCP requests? 14 | # Separate multiple interfaces with spaces, e.g. "eth0 eth1". 15 | INTERFACES="{{ dhcpd.listen_interfaces | join(' ') }}" 16 | -------------------------------------------------------------------------------- /dhcpd/files/service_config.FreeBSD: -------------------------------------------------------------------------------- 1 | # SaltStack-generated demon configuration file for ISC dhcpd 2 | 3 | dhcpd_ifaces="{{ dhcpd.listen_interfaces | join(' ') }}" 4 | -------------------------------------------------------------------------------- /dhcpd/files/service_config.Gentoo: -------------------------------------------------------------------------------- 1 | # SaltStack-generated demon configuration file for ISC dhcpd 2 | 3 | # If you require more than one instance of dhcpd you can create symbolic 4 | # links to dhcpd service like so 5 | # cd /etc/init.d 6 | # ln -s dhcpd dhcpd.foo 7 | # cd ../conf.d 8 | # cp dhcpd dhcpd.foo 9 | # Now you can edit dhcpd.foo and specify a different configuration file. 10 | # You'll also need to specify a pidfile in that dhcpd.conf file. 11 | # See the pid-file-name option in the dhcpd.conf man page for details. 12 | 13 | # If you wish to run dhcpd in a chroot, uncomment the following line 14 | # DHCPD_CHROOT="/var/lib/dhcp/chroot" 15 | 16 | # All file paths below are relative to the chroot. 17 | # You can specify a different chroot directory but MAKE SURE it's empty. 18 | 19 | # Specify a configuration file - the default is /etc/dhcp/dhcpd.conf 20 | # DHCPD_CONF="/etc/dhcp/dhcpd.conf" 21 | 22 | # Configure which interface or interfaces to for dhcpd to listen on. 23 | # List all interfaces space separated. If this is not specified then 24 | # we listen on all interfaces. 25 | DHCPD_IFACE="{{ dhcpd.listen_interfaces | join(' ') }}" 26 | 27 | # Insert any other dhcpd options - see the man page for a full list. 28 | # DHCPD_OPTS="" 29 | -------------------------------------------------------------------------------- /dhcpd/files/service_config.RedHat: -------------------------------------------------------------------------------- 1 | [Service] 2 | ExecStart= 3 | ExecStart=/usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -user dhcpd -group dhcpd --no-pid {{ dhcpd.listen_interfaces | join(' ') }} 4 | -------------------------------------------------------------------------------- /dhcpd/files/subnet.jinja: -------------------------------------------------------------------------------- 1 | {%- if 'comment' in config %} 2 | {%- for line in config['comment'].splitlines() %} 3 | # {{ line }} 4 | {%- endfor %} 5 | {%- endif %} 6 | subnet {{ subnet }} netmask {{ config.netmask }} { 7 | {%- if 'use_host_decl_names' in config %} 8 | use-host-decl-names {{ config.use_host_decl_names }}; 9 | {%- endif %} 10 | {%- if 'range' in config %} 11 | {%- if 'dynamic_bootp' in config and config.dynamic_bootp %} 12 | range dynamic-bootp {{ config.range[0] }} {{ config.range[1] }}; 13 | {%- else %} 14 | range {{ config.range[0] }} {{ config.range[1] }}; 15 | {%- endif %} 16 | {%- endif %} 17 | {%- if 'broadcast_address' in config %} 18 | option broadcast-address {{ config['broadcast_address'] }}; 19 | {%- endif %} 20 | {%- if 'domain_name_servers' in config %} 21 | option domain-name-servers {{ config['domain_name_servers']|join(',') }}; 22 | {%- endif %} 23 | {%- if 'netbios_name_servers' in config %} 24 | option netbios-name-servers {{ config['netbios_name_servers']|join(',') }}; 25 | {%- endif %} 26 | {%- if 'ntp_servers' in config %} 27 | option ntp-servers {{ config['ntp_servers']|join(',') }}; 28 | {%- endif %} 29 | {%- if 'lpr_servers' in config %} 30 | option lpr-servers {{ config['lpr_servers']|join(',') }}; 31 | {%- endif %} 32 | {%- if 'irc_server' in config %} 33 | option irc-server {{ config['irc_server']|join(',') }}; 34 | {%- endif %} 35 | {%- if 'tftp_server_name' in config %} 36 | option tftp-server-name "{{ config['tftp_server_name'] }}"; 37 | {%- endif %} 38 | {%- if 'smtp_server' in config %} 39 | option smtp-server {{ config['smtp_server'] }}; 40 | {%- endif %} 41 | {%- if 'domain_name' in config %} 42 | option domain-name "{{ config['domain_name'] }}"; 43 | {%- endif %} 44 | {%- if 'ddns_rev_domainname' in config %} 45 | ddns-rev-domainname "{{ config['ddns_rev_domainname'] }}"; 46 | {%- endif %} 47 | {%- if 'ddns_domainname' in config %} 48 | ddns-domainname "{{ config['ddns_domainname'] }}"; 49 | {%- endif %} 50 | {%- if 'domain_search' in config %} 51 | option domain-search "{{ config['domain_search']|join('","') }}"; 52 | {%- endif %} 53 | {%- if 'filename' in config %} 54 | filename "{{ config['filename'] }}"; 55 | {%- endif %} 56 | {%- if 'next_server' in config %} 57 | next-server {{ config['next_server'] }}; 58 | {%- endif %} 59 | {%- if 'default_lease_time' in config %} 60 | default-lease-time {{ config['default_lease_time'] }}; 61 | {%- endif %} 62 | {%- if 'max_lease_time' in config %} 63 | max-lease-time {{ config['max_lease_time'] }}; 64 | {%- endif %} 65 | {%- if 'routers' in config and config.routers is string %} 66 | option routers {{ config.routers }}; 67 | {%- elif 'routers' in config and config.routers is sequence %} 68 | option routers 69 | {%- for router in config.routers %} {{ router }} 70 | {%- if not loop.last %},{% else %};{% endif %} 71 | {%- endfor %} 72 | {%- endif %} 73 | {%- for option in dhcpd.customized_options.keys() %} 74 | {%- if option in config %} 75 | {%- if dhcpd.customized_options[option]['type'] in types_to_quote %} {% set quote = dquote %} {%- endif %} 76 | option {{ option|replace('_', '-') }} {{ quote }}{{ config.get(option) }}{{ quote }}; 77 | {%- endif %} 78 | {%- endfor %} 79 | {%- for pool in config.get( 'pools', [] ) %} 80 | pool { 81 | {%- if 'failover_peer' in pool %} 82 | failover peer "{{ pool['failover_peer'] }}"; 83 | {%- endif %} 84 | {%- if 'max_lease_time' in pool %} 85 | max-lease-time {{ pool.max_lease_time }}; 86 | {%- endif %} 87 | {%- if 'range' in pool %} 88 | range {{ pool.range[0] }} {{ pool.range[1] }}; 89 | {%- endif %} 90 | {%- if 'allow' in pool %} 91 | allow {{ pool.allow }}; 92 | {%- elif 'deny' in pool %} 93 | deny {{ pool.deny }}; 94 | {%- endif %} 95 | } 96 | {%- endfor %} 97 | {%- for host, config in config.get('hosts', {}).items() %} 98 | {%- filter indent(width=2) %} 99 | {% include 'dhcpd/files/host.jinja' with context %} 100 | {%- endfilter %} 101 | {%- endfor %} 102 | } 103 | -------------------------------------------------------------------------------- /dhcpd/init.sls: -------------------------------------------------------------------------------- 1 | {% from "dhcpd/map.jinja" import dhcpd with context %} 2 | 3 | dhcpd: 4 | pkg.installed: 5 | - name: {{ dhcpd.server }} 6 | {% if dhcpd.enable is defined and not dhcpd.enable %} 7 | service.dead: 8 | - name: {{ dhcpd.service }} 9 | - enable: False 10 | {% else %} 11 | service.running: 12 | - name: {{ dhcpd.service }} 13 | - enable: True 14 | - require: 15 | - pkg: {{ dhcpd.server }} 16 | - require: 17 | - file: {{ dhcpd.config }} 18 | {% endif %} 19 | -------------------------------------------------------------------------------- /dhcpd/map.jinja: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=jinja 3 | 4 | {#- Get the `tplroot` from `tpldir` #} 5 | {%- set tplroot = tpldir.split('/')[0] %} 6 | {#- Start imports as #} 7 | {%- import_yaml tplroot ~ "/defaults.yaml" as default_settings %} 8 | {%- import_yaml tplroot ~ "/osarchmap.yaml" as osarchmap %} 9 | {%- import_yaml tplroot ~ "/osfamilymap.yaml" as osfamilymap %} 10 | {%- import_yaml tplroot ~ "/osmap.yaml" as osmap %} 11 | {%- import_yaml tplroot ~ "/osfingermap.yaml" as osfingermap %} 12 | 13 | {#- Retrieve the config dict only once #} 14 | {%- set _config = salt['config.get'](tplroot, default={}) %} 15 | 16 | {%- set defaults = salt['grains.filter_by']( 17 | default_settings, 18 | default=tplroot, 19 | merge=salt['grains.filter_by']( 20 | osarchmap, 21 | grain='osarch', 22 | merge=salt['grains.filter_by']( 23 | osfamilymap, 24 | grain='os_family', 25 | merge=salt['grains.filter_by']( 26 | osmap, 27 | grain='os', 28 | merge=salt['grains.filter_by']( 29 | osfingermap, 30 | grain='osfinger', 31 | merge=salt['grains.filter_by']( 32 | _config, 33 | default='lookup' 34 | ) 35 | ) 36 | ) 37 | ) 38 | ) 39 | ) 40 | %} 41 | 42 | {%- set config = salt['grains.filter_by']( 43 | {'defaults': defaults}, 44 | default='defaults', 45 | merge=_config 46 | ) 47 | %} 48 | 49 | {%- set dhcpd = config %} 50 | -------------------------------------------------------------------------------- /dhcpd/osarchmap.yaml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | # 4 | # Setup variables using grains['osarch'] based logic. 5 | # You just need to add the key:values for an `osarch` that differ 6 | # from `defaults.yaml`. 7 | # Only add an `osarch` which is/will be supported by the formula. 8 | # 9 | # If you do not need to provide defaults via the `osarch` grain, 10 | # you will need to provide at least an empty dict in this file, e.g. 11 | # osarch: {} 12 | --- 13 | amd64: 14 | arch: amd64 15 | 16 | x86_64: 17 | arch: amd64 18 | 19 | 386: 20 | arch: 386 21 | 22 | arm64: 23 | arch: arm64 24 | 25 | armv6l: 26 | arch: armv6l 27 | 28 | armv7l: 29 | arch: armv7l 30 | 31 | ppc64le: 32 | arch: ppc64le 33 | 34 | s390x: 35 | arch: s390x 36 | -------------------------------------------------------------------------------- /dhcpd/osfamilymap.yaml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | # 4 | # Setup variables using grains['os_family'] based logic. 5 | # You just need to add the key:values for an `os_family` that differ 6 | # from `defaults.yaml` + `osarch.yaml`. 7 | # Only add an `os_family` which is/will be supported by the formula. 8 | # 9 | # If you do not need to provide defaults via the `os_family` grain, 10 | # you will need to provide at least an empty dict in this file, e.g. 11 | # osfamilymap: {} 12 | --- 13 | Debian: 14 | config: /etc/dhcp/dhcpd.conf 15 | server: isc-dhcp-server 16 | service: isc-dhcp-server 17 | service_config: /etc/default/isc-dhcp-server 18 | 19 | RedHat: 20 | config: /etc/dhcp/dhcpd.conf 21 | server: dhcp 22 | service: dhcpd 23 | service_config: /etc/systemd/system/dhcpd.service.d/override.conf 24 | 25 | Suse: 26 | config: /etc/dhcpd.conf 27 | server: dhcp-server 28 | service: dhcpd 29 | 30 | Gentoo: 31 | server: net-misc/dhcp 32 | service: dhcpd 33 | config: /etc/dhcp/dhcpd.conf 34 | service_config: /etc/conf.d/dhcpd 35 | 36 | Arch: 37 | config: /etc/dhcpd.conf 38 | server: dhcp 39 | service: dhcpd4 40 | 41 | Alpine: {} 42 | 43 | FreeBSD: 44 | rootgroup: wheel 45 | config: /usr/local/etc/dhcpd.conf 46 | server: isc-dhcp43-server 47 | service: isc-dhcpd 48 | service_config: /etc/rc.conf.d/dhcpd 49 | 50 | OpenBSD: {} 51 | 52 | Solaris: {} 53 | 54 | Windows: {} 55 | 56 | MacOS: {} 57 | -------------------------------------------------------------------------------- /dhcpd/osfingermap.yaml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | # 4 | # Setup variables using grains['osfinger'] based logic. 5 | # You just need to add the key:values for an `osfinger` that differ 6 | # from `defaults.yaml` + `osarch.yaml` + `os_family.yaml` + `osmap.yaml`. 7 | # Only add an `osfinger` which is/will be supported by the formula. 8 | # 9 | # If you do not need to provide defaults via the `os_finger` grain, 10 | # you will need to provide at least an empty dict in this file, e.g. 11 | # osfingermap: {} 12 | --- 13 | # os: Debian 14 | Debian-10: {} 15 | Debian-9: {} 16 | Debian-8: {} 17 | 18 | # os: Ubuntu 19 | Ubuntu-18.04: {} 20 | Ubuntu-16.04: {} 21 | 22 | # os: Fedora 23 | Fedora-31: {} 24 | Fedora-30: {} 25 | 26 | # os: CentOS 27 | CentOS Linux-8: {} 28 | CentOS Linux-7: {} 29 | CentOS-6: {} 30 | 31 | # os: Amazon 32 | Amazon Linux-2: {} 33 | Amazon Linux AMI-2018: {} 34 | 35 | # os: SUSE 36 | Leap-15: {} 37 | 38 | # os: FreeBSD 39 | FreeBSD-12: {} 40 | 41 | # os: Windows 42 | Windows-8.1: {} 43 | 44 | # os: Gentoo 45 | Gentoo-2: {} 46 | -------------------------------------------------------------------------------- /dhcpd/osmap.yaml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | # 4 | # Setup variables using grains['os'] based logic. 5 | # You just need to add the key:values for an `os` that differ 6 | # from `defaults.yaml` + `osarch.yaml` + `os_family.yaml`. 7 | # Only add an `os` which is/will be supported by the formula. 8 | # 9 | # If you do not need to provide defaults via the `os` grain, 10 | # you will need to provide at least an empty dict in this file, e.g. 11 | # osmap: {} 12 | --- 13 | # os_family: Debian 14 | Ubuntu: {} 15 | Raspbian: {} 16 | 17 | # os_family: RedHat 18 | Fedora: 19 | server: dhcp-server 20 | CentOS: {} 21 | Amazon: {} 22 | 23 | # os_family: Suse 24 | SUSE: {} 25 | openSUSE: {} 26 | 27 | # os_family: Gentoo 28 | Funtoo: {} 29 | 30 | # os_family: Arch 31 | Manjaro: {} 32 | 33 | # os_family: Solaris 34 | SmartOS: {} 35 | -------------------------------------------------------------------------------- /docs/AUTHORS.rst: -------------------------------------------------------------------------------- 1 | .. role:: raw-html-m2r(raw) 2 | :format: html 3 | 4 | 5 | Authors 6 | ======= 7 | 8 | This list is sorted by the number of commits per contributor in *descending* order. 9 | 10 | .. list-table:: 11 | :header-rows: 1 12 | 13 | * - Avatar 14 | - Contributor 15 | - Contributions 16 | * - :raw-html-m2r:`@myii` 17 | - `@myii `_ 18 | - 130 19 | * - :raw-html-m2r:`@baby-gnu` 20 | - `@baby-gnu `_ 21 | - 14 22 | * - :raw-html-m2r:`@aboe76` 23 | - `@aboe76 `_ 24 | - 11 25 | * - :raw-html-m2r:`@0xf10e` 26 | - `@0xf10e `_ 27 | - 10 28 | * - :raw-html-m2r:`@gravyboat` 29 | - `@gravyboat `_ 30 | - 10 31 | * - :raw-html-m2r:`@nmadhok` 32 | - `@nmadhok `_ 33 | - 6 34 | * - :raw-html-m2r:`@tampakrap` 35 | - `@tampakrap `_ 36 | - 5 37 | * - :raw-html-m2r:`@kiwiz` 38 | - `@kiwiz `_ 39 | - 5 40 | * - :raw-html-m2r:`@aaannz` 41 | - `@aaannz `_ 42 | - 4 43 | * - :raw-html-m2r:`@ukretschmer` 44 | - `@ukretschmer `_ 45 | - 4 46 | * - :raw-html-m2r:`@daschatten` 47 | - `@daschatten `_ 48 | - 4 49 | * - :raw-html-m2r:`@dafyddj` 50 | - `@dafyddj `_ 51 | - 3 52 | * - :raw-html-m2r:`@techhat` 53 | - `@techhat `_ 54 | - 3 55 | * - :raw-html-m2r:`@thatch45` 56 | - `@thatch45 `_ 57 | - 3 58 | * - :raw-html-m2r:`@sticky-note` 59 | - `@sticky-note `_ 60 | - 3 61 | * - :raw-html-m2r:`@stp-ip` 62 | - `@stp-ip `_ 63 | - 2 64 | * - :raw-html-m2r:`@skylerberg` 65 | - `@skylerberg `_ 66 | - 2 67 | * - :raw-html-m2r:`@ixs` 68 | - `@ixs `_ 69 | - 1 70 | * - :raw-html-m2r:`@word` 71 | - `@word `_ 72 | - 1 73 | * - :raw-html-m2r:`@bmwiedemann` 74 | - `@bmwiedemann `_ 75 | - 1 76 | * - :raw-html-m2r:`@javierbertoli` 77 | - `@javierbertoli `_ 78 | - 1 79 | * - :raw-html-m2r:`@mthibaut` 80 | - `@mthibaut `_ 81 | - 1 82 | * - :raw-html-m2r:`@mgomersbach` 83 | - `@mgomersbach `_ 84 | - 1 85 | * - :raw-html-m2r:`@robinelfrink` 86 | - `@robinelfrink `_ 87 | - 1 88 | 89 | 90 | ---- 91 | 92 | Auto-generated by a `forked version `_ of `gaocegege/maintainer `_ on 2021-10-20. 93 | -------------------------------------------------------------------------------- /docs/README.rst: -------------------------------------------------------------------------------- 1 | .. _readme: 2 | 3 | dhcpd 4 | ===== 5 | 6 | |img_travis| |img_sr| 7 | 8 | .. |img_travis| image:: https://travis-ci.com/saltstack-formulas/dhcpd-formula.svg?branch=master 9 | :alt: Travis CI Build Status 10 | :scale: 100% 11 | :target: https://travis-ci.com/saltstack-formulas/dhcpd-formula 12 | .. |img_sr| image:: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg 13 | :alt: Semantic Release 14 | :scale: 100% 15 | :target: https://github.com/semantic-release/semantic-release 16 | 17 | Formula to install, configure and start dhcpd. 18 | 19 | .. contents:: **Table of Contents** 20 | 21 | General notes 22 | ------------- 23 | 24 | See the full `SaltStack Formulas installation and usage instructions 25 | `_. 26 | 27 | If you are interested in writing or contributing to formulas, please pay attention to the `Writing Formula Section 28 | `_. 29 | 30 | If you want to use this formula, please pay attention to the ``FORMULA`` file and/or ``git tag``, 31 | which contains the currently released version. This formula is versioned according to `Semantic Versioning `_. 32 | 33 | See `Formula Versioning Section `_ for more details. 34 | 35 | Contributing to this repo 36 | ------------------------- 37 | 38 | **Commit message formatting is significant!!** 39 | 40 | Please see `How to contribute `_ for more details. 41 | 42 | Available states 43 | ---------------- 44 | 45 | .. contents:: 46 | :local: 47 | 48 | ``dhcpd`` 49 | --------- 50 | 51 | Install and turn on dhcpd. 52 | 53 | .. note:: 54 | 55 | To have more pythonic variables the dashes ('-') in their names 56 | are replaced with underscores ('_') so 'dynamic-bootp' becomes 57 | 'dynamic_bootp' in pillar[dhcpd]. 58 | 59 | ``dhcpd.config`` 60 | ---------------- 61 | 62 | Manage configuration for dhcpd. 63 | See ``pillar.example`` for pillar-data for a sample configuration. 64 | 65 | Testing 66 | ------- 67 | 68 | Linux testing is done with ``kitchen-salt``. 69 | 70 | Requirements 71 | ^^^^^^^^^^^^ 72 | 73 | * Ruby 74 | * Docker 75 | 76 | .. code-block:: bash 77 | 78 | $ gem install bundler 79 | $ bundle install 80 | $ bin/kitchen test [platform] 81 | 82 | Where ``[platform]`` is the platform name defined in ``kitchen.yml``, 83 | e.g. ``debian-9-2019-2-py3``. 84 | 85 | ``bin/kitchen converge`` 86 | ^^^^^^^^^^^^^^^^^^^^^^^^ 87 | 88 | Creates the docker instance and runs the ``dhcpd.config`` main state, ready for testing. 89 | 90 | ``bin/kitchen verify`` 91 | ^^^^^^^^^^^^^^^^^^^^^^ 92 | 93 | Runs the ``inspec`` tests on the actual instance. 94 | 95 | ``bin/kitchen destroy`` 96 | ^^^^^^^^^^^^^^^^^^^^^^^ 97 | 98 | Removes the docker instance. 99 | 100 | ``bin/kitchen test`` 101 | ^^^^^^^^^^^^^^^^^^^^ 102 | 103 | Runs all of the stages above in one go: i.e. ``destroy`` + ``converge`` + ``verify`` + ``destroy``. 104 | 105 | ``bin/kitchen login`` 106 | ^^^^^^^^^^^^^^^^^^^^^ 107 | 108 | Gives you SSH access to the instance for manual testing. 109 | -------------------------------------------------------------------------------- /pillar.example: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | dhcpd: 5 | # Change some defaults 6 | lookup: 7 | enable: false 8 | 9 | allow: 10 | - booting 11 | - bootp 12 | deny: unknown-clients 13 | domain_name: example.org 14 | domain_name_servers: 15 | - ns1.example.org 16 | - ns2.example.org 17 | default_lease_time: 600 18 | max_lease_time: 7200 19 | log_facility: local7 20 | failover_peers: 21 | dhcp-failover: 22 | primary: true 23 | address: 10.152.187.5 24 | port: 647 25 | peer_address: 10.152.187.6 26 | peer_port: 647 27 | split: 128 28 | mclt: 3600 29 | listen_interfaces: 30 | - em1 31 | - em2 32 | 33 | ## LDAP Backend Configuration 34 | ## When ldap backend configuration is used 35 | ## all other configurations are ignored. 36 | # ldap_server: localhost 37 | # ldap_port: 389 38 | # ldap_username: cn=dhcpadmin,dc=example,dc=com 39 | # ldap_password: dhcppassword 40 | # ldap_base_dn: ou=dhcp,dc=example,dc=com 41 | # ldap_method: dynamic 42 | # ldap_debug_file: /var/log/dhcp-ldap-startup.log 43 | 44 | subnets: 45 | 10.152.187.0: 46 | comment: |- 47 | No service will be given on this subnet, but declaring it helps the 48 | DHCP server to understand the network topology. 49 | netmask: 255.255.255.0 50 | pools: 51 | - failover_peer: dhcp-failover 52 | range: 53 | - 10.152.187.1 54 | - 10.152.187.254 55 | 56 | 10.254.239.0: 57 | comment: This is a very basic subnet declaration. 58 | netmask: 255.255.255.224 59 | range: 60 | - 10.254.239.10 61 | - 10.254.239.20 62 | routers: 63 | - rtr-239-0-1.example.org 64 | - rtr-239-0-2.example.org 65 | 66 | 10.254.239.32: 67 | comment: |- 68 | This declaration allows BOOTP clients to get dynamic addresses, 69 | which we don't really recommend. 70 | netmask: 255.255.255.224 71 | dynamic_bootp: true 72 | range: 73 | - 10.254.239.40 74 | - 10.254.239.60 75 | broadcast_address: 10.254.239.31 76 | routers: rtr-239-32-1.example.org 77 | 78 | 10.5.5.0: 79 | comment: A slightly different configuration for an internal subnet. 80 | netmask: 255.255.255.224 81 | range: 82 | - 10.5.5.26 83 | - 10.5.5.30 84 | domain_name_servers: 85 | - ns1.internal.example.org 86 | domain_name: internal.example.org 87 | routers: 88 | - 10.5.5.1 89 | broadcast_address: 10.5.5.31 90 | default_lease_time: 600 91 | max_lease_time: 7200 92 | hosts: 93 | jake: 94 | comment: |- 95 | Hosts can be specified for subnets, taking subnets defaults 96 | hardware: ethernet 08:00:a7:26:c0:a9 97 | fixed_address: 10.5.5.27 98 | 99 | # End of subnets 100 | 101 | hosts: 102 | passacaglia: 103 | comment: |- 104 | Hosts which require special configuration options can be listed in 105 | host statements. If no address is specified, the address will be 106 | allocated dynamically (if possible), but the host-specific information 107 | will still come from the host declaration. 108 | # We're lucky we don't need the MAC as a key... 109 | hardware: ethernet 0:0:c0:5d:bd:95 110 | filename: vmunix.passacaglia 111 | server_name: toccata.fugue.com 112 | 113 | fantasia: 114 | comment: |- 115 | Fixed IP addresses can also be specified for hosts. These addresses 116 | should not also be listed as being available for dynamic assignment. 117 | Hosts for which fixed IP addresses have been specified can boot using 118 | BOOTP or DHCP. Hosts for which no fixed address is specified can only 119 | be booted with DHCP, unless there is an address range on the subnet 120 | to which a BOOTP client is connected which has the dynamic-bootp flag 121 | set. 122 | hardware: ethernet 08:00:07:26:c0:a5 123 | fixed_address: fantasia.fugue.com 124 | 125 | joe: 126 | comment: |- 127 | The hostname for a host can be passed in the DHCP response. Using the 128 | host_name key sets option host-name in the dhcpd configuration. 129 | hardware: ethernet 08:00:2b:4c:29:32 130 | fixed_address: joe.fugue.com 131 | host_name: joe 132 | 133 | classes: 134 | foo: 135 | comment: |- 136 | You can declare a class of clients and then do address allocation 137 | based on that. The example below shows a case where all clients 138 | in a certain class get addresses on the 10.17.224/24 subnet, and all 139 | other clients get addresses on the 10.0.29/24 subnet. 140 | # I'm suprised this works... 141 | match: if substring (option vendor-class-identifier, 0, 4) = "SUNW" 142 | 143 | shared_networks: 144 | 224-29: 145 | subnets: 146 | 10.17.224.0: 147 | netmask: 255.255.255.0 148 | routers: rtr-224.example.org 149 | 10.0.29.0: 150 | netmask: 255.255.255.0 151 | routers: rtr-29.example.org 152 | pools: 153 | # And no, those quotation marks won't get stripped: 154 | - allow: members of "foo" 155 | range: 156 | - 10.17.224.10 157 | - 10.17.224.250 158 | - deny: members of "foo" 159 | range: 160 | - 10.0.29.10 161 | - 10.0.29.230 162 | 163 | # DHCP allow customized options, which, once declared, can be used as same 164 | # as the default options on every level, e.g. as global or subnet option. 165 | # These options will be declared on top of dhcpd.conf. 166 | # They consist of a NAME (Attention! '_' will be replaced by '-'), a CODE 167 | # number and a DATATYPE (e.g. string, text, integer, ip-address) 168 | customized_options: 169 | # unique option name, e.g. 'auto_proxy_config' will be 'auto-proxy-config' 170 | auto_proxy_config: 171 | code: 252 172 | type: string 173 | -------------------------------------------------------------------------------- /pre-commit_semantic-release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ############################################################################### 4 | # (A) Update `FORMULA` with `${nextRelease.version}` 5 | ############################################################################### 6 | sed -i -e "s_^\(version:\).*_\1 ${1}_" FORMULA 7 | 8 | 9 | ############################################################################### 10 | # (B) Use `m2r2` to convert automatically produced `.md` docs to `.rst` 11 | ############################################################################### 12 | 13 | # Install `m2r2` 14 | pip3 install m2r2 15 | 16 | # Copy and then convert the `.md` docs 17 | cp ./*.md docs/ 18 | cd docs/ || exit 19 | m2r2 --overwrite ./*.md 20 | 21 | # Change excess `H1` headings to `H2` in converted `CHANGELOG.rst` 22 | sed -i -e '/^=.*$/s/=/-/g' CHANGELOG.rst 23 | sed -i -e '1,4s/-/=/g' CHANGELOG.rst 24 | 25 | # Use for debugging output, when required 26 | # cat AUTHORS.rst 27 | # cat CHANGELOG.rst 28 | 29 | # Return back to the main directory 30 | cd .. 31 | -------------------------------------------------------------------------------- /release-rules.js: -------------------------------------------------------------------------------- 1 | // No release is triggered for the types commented out below. 2 | // Commits using these types will be incorporated into the next release. 3 | // 4 | // NOTE: Any changes here must be reflected in `CONTRIBUTING.md`. 5 | module.exports = [ 6 | {breaking: true, release: 'major'}, 7 | // {type: 'build', release: 'patch'}, 8 | // {type: 'chore', release: 'patch'}, 9 | // {type: 'ci', release: 'patch'}, 10 | {type: 'docs', release: 'patch'}, 11 | {type: 'feat', release: 'minor'}, 12 | {type: 'fix', release: 'patch'}, 13 | {type: 'perf', release: 'patch'}, 14 | {type: 'refactor', release: 'patch'}, 15 | {type: 'revert', release: 'patch'}, 16 | {type: 'style', release: 'patch'}, 17 | {type: 'test', release: 'patch'}, 18 | ]; 19 | -------------------------------------------------------------------------------- /release.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | branch: 'master', 3 | repositoryUrl: 'https://github.com/saltstack-formulas/dhcpd-formula', 4 | plugins: [ 5 | ['@semantic-release/commit-analyzer', { 6 | preset: 'angular', 7 | releaseRules: './release-rules.js', 8 | }], 9 | '@semantic-release/release-notes-generator', 10 | ['@semantic-release/changelog', { 11 | changelogFile: 'CHANGELOG.md', 12 | changelogTitle: '# Changelog', 13 | }], 14 | ['@semantic-release/exec', { 15 | prepareCmd: 'sh ./pre-commit_semantic-release.sh ${nextRelease.version}', 16 | }], 17 | ['@semantic-release/git', { 18 | assets: ['*.md', 'docs/*.rst', 'FORMULA'], 19 | }], 20 | '@semantic-release/github', 21 | ], 22 | generateNotes: { 23 | preset: 'angular', 24 | writerOpts: { 25 | // Required due to upstream bug preventing all types being displayed. 26 | // Bug: https://github.com/conventional-changelog/conventional-changelog/issues/317 27 | // Fix: https://github.com/conventional-changelog/conventional-changelog/pull/410 28 | transform: (commit, context) => { 29 | const issues = [] 30 | 31 | commit.notes.forEach(note => { 32 | note.title = `BREAKING CHANGES` 33 | }) 34 | 35 | // NOTE: Any changes here must be reflected in `CONTRIBUTING.md`. 36 | if (commit.type === `feat`) { 37 | commit.type = `Features` 38 | } else if (commit.type === `fix`) { 39 | commit.type = `Bug Fixes` 40 | } else if (commit.type === `perf`) { 41 | commit.type = `Performance Improvements` 42 | } else if (commit.type === `revert`) { 43 | commit.type = `Reverts` 44 | } else if (commit.type === `docs`) { 45 | commit.type = `Documentation` 46 | } else if (commit.type === `style`) { 47 | commit.type = `Styles` 48 | } else if (commit.type === `refactor`) { 49 | commit.type = `Code Refactoring` 50 | } else if (commit.type === `test`) { 51 | commit.type = `Tests` 52 | } else if (commit.type === `build`) { 53 | commit.type = `Build System` 54 | // } else if (commit.type === `chore`) { 55 | // commit.type = `Maintenance` 56 | } else if (commit.type === `ci`) { 57 | commit.type = `Continuous Integration` 58 | } else { 59 | return 60 | } 61 | 62 | if (commit.scope === `*`) { 63 | commit.scope = `` 64 | } 65 | 66 | if (typeof commit.hash === `string`) { 67 | commit.shortHash = commit.hash.substring(0, 7) 68 | } 69 | 70 | if (typeof commit.subject === `string`) { 71 | let url = context.repository 72 | ? `${context.host}/${context.owner}/${context.repository}` 73 | : context.repoUrl 74 | if (url) { 75 | url = `${url}/issues/` 76 | // Issue URLs. 77 | commit.subject = commit.subject.replace(/#([0-9]+)/g, (_, issue) => { 78 | issues.push(issue) 79 | return `[#${issue}](${url}${issue})` 80 | }) 81 | } 82 | if (context.host) { 83 | // User URLs. 84 | commit.subject = commit.subject.replace(/\B@([a-z0-9](?:-?[a-z0-9/]){0,38})/g, (_, username) => { 85 | if (username.includes('/')) { 86 | return `@${username}` 87 | } 88 | 89 | return `[@${username}](${context.host}/${username})` 90 | }) 91 | } 92 | } 93 | 94 | // remove references that already appear in the subject 95 | commit.references = commit.references.filter(reference => { 96 | if (issues.indexOf(reference.issue) === -1) { 97 | return true 98 | } 99 | 100 | return false 101 | }) 102 | 103 | return commit 104 | }, 105 | }, 106 | }, 107 | }; 108 | -------------------------------------------------------------------------------- /test/integration/default/README.md: -------------------------------------------------------------------------------- 1 | # InSpec Profile: `default` 2 | 3 | This shows the implementation of the `default` InSpec [profile](https://github.com/inspec/inspec/blob/master/docs/profiles.md). 4 | 5 | ## Verify a profile 6 | 7 | InSpec ships with built-in features to verify a profile structure. 8 | 9 | ```bash 10 | $ inspec check default 11 | Summary 12 | ------- 13 | Location: default 14 | Profile: profile 15 | Controls: 4 16 | Timestamp: 2019-06-24T23:09:01+00:00 17 | Valid: true 18 | 19 | Errors 20 | ------ 21 | 22 | Warnings 23 | -------- 24 | ``` 25 | 26 | ## Execute a profile 27 | 28 | To run all **supported** controls on a local machine use `inspec exec /path/to/profile`. 29 | 30 | ```bash 31 | $ inspec exec default 32 | .. 33 | 34 | Finished in 0.0025 seconds (files took 0.12449 seconds to load) 35 | 8 examples, 0 failures 36 | ``` 37 | 38 | ## Execute a specific control from a profile 39 | 40 | To run one control from the profile use `inspec exec /path/to/profile --controls name`. 41 | 42 | ```bash 43 | $ inspec exec default --controls package 44 | . 45 | 46 | Finished in 0.0025 seconds (files took 0.12449 seconds to load) 47 | 1 examples, 0 failures 48 | ``` 49 | 50 | See an [example control here](https://github.com/inspec/inspec/blob/master/examples/profile/controls/example.rb). 51 | -------------------------------------------------------------------------------- /test/integration/default/controls/_mapdata.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'yaml' 4 | 5 | control 'dhcpd._mapdata' do 6 | title '`map.jinja` should match the reference file' 7 | 8 | ### Method 9 | # The steps below for each file appear convoluted but they are both required 10 | # and similar in nature: 11 | # 1. The earliest method was to simply compare the files textually but this often 12 | # led to false positives due to inconsistencies (e.g. spacing, ordering) 13 | # 2. The next method was to load the files back into YAML structures and then 14 | # compare but InSpec provided block diffs this way, unusable by end users 15 | # 3. The final step was to dump the YAML structures back into a string to use 16 | # for the comparison; this both worked and provided human-friendly diffs 17 | 18 | ### Comparison file for the specific platform 19 | ### Static, adjusted as part of code contributions, as map data is changed 20 | # Strip the `platform[:finger]` version number down to the "OS major release" 21 | platform_finger = system.platform[:finger].split('.').first.to_s 22 | # Use that to set the path to the file (relative to the InSpec suite directory) 23 | mapdata_file_path = "_mapdata/#{platform_finger}.yaml" 24 | # Load the mapdata from profile, into a YAML structure 25 | # https://docs.chef.io/inspec/profiles/#profile-files 26 | mapdata_file_yaml = YAML.load(inspec.profile.file(mapdata_file_path)) 27 | # Dump the YAML back into a string for comparison 28 | mapdata_file_dump = YAML.dump(mapdata_file_yaml) 29 | 30 | ### Output file produced by running the `_mapdata` state 31 | ### Dynamic, generated during Kitchen's `converge` phase 32 | # Derive the location of the dumped mapdata (differs for Windows) 33 | output_dir = platform[:family] == 'windows' ? '/temp' : '/tmp' 34 | # Use that to set the path to the file (absolute path, i.e. within the container) 35 | output_file_path = "#{output_dir}/salt_mapdata_dump.yaml" 36 | # Load the output into a YAML structure using InSpec's `yaml` resource 37 | # https://github.com/inspec/inspec/blob/49b7d10/lib/inspec/resources/yaml.rb#L29 38 | output_file_yaml = yaml(output_file_path).params 39 | # Dump the YAML back into a string for comparison 40 | output_file_dump = YAML.dump(output_file_yaml) 41 | 42 | describe 'File content' do 43 | it 'should match profile map data exactly' do 44 | expect(output_file_dump).to eq(mapdata_file_dump) 45 | end 46 | end 47 | end 48 | -------------------------------------------------------------------------------- /test/integration/default/controls/config_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Default values 4 | config_filename = '/etc/dhcp/dhcpd.conf' 5 | rootgroup = 'root' 6 | # Overide by platform 7 | case platform[:family] 8 | when 'debian' 9 | service_config_filename = '/etc/default/isc-dhcp-server' 10 | service_config_file_contents = <<~SERVICE_CONFIG_FILE.chomp 11 | # SaltStack-generated demon configuration file for ISC dhcpd 12 | 13 | # Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf). 14 | #DHCPD_CONF=/etc/dhcp/dhcpd.conf 15 | 16 | # Path to dhcpd's PID file (default: /var/run/dhcpd.pid). 17 | #DHCPD_PID=/var/run/dhcpd.pid 18 | 19 | # Additional options to start dhcpd with. 20 | # Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead 21 | #OPTIONS="" 22 | 23 | # On what interfaces should the DHCP server (dhcpd) serve DHCP requests? 24 | # Separate multiple interfaces with spaces, e.g. "eth0 eth1". 25 | INTERFACES="em1 em2" 26 | SERVICE_CONFIG_FILE 27 | when 'redhat', 'fedora' 28 | service_config_filename = '/etc/systemd/system/dhcpd.service.d/override.conf' 29 | service_config_file_contents = <<~SERVICE_CONFIG_FILE.chomp 30 | [Service] 31 | ExecStart= 32 | ExecStart=/usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -user dhcpd -group dhcpd --no-pid em1 em2 33 | SERVICE_CONFIG_FILE 34 | when 'suse' 35 | config_filename = '/etc/dhcpd.conf' 36 | when 'freebsd' 37 | config_filename = '/usr/local/etc/dhcpd.conf' 38 | rootgroup = 'wheel' 39 | service_config_filename = '/etc/rc.conf.d/dhcpd' 40 | service_config_file_contents = <<~SERVICE_CONFIG_FILE.chomp 41 | # SaltStack-generated demon configuration file for ISC dhcpd 42 | 43 | dhcpd_ifaces="em1 em2" 44 | SERVICE_CONFIG_FILE 45 | when 'linux' 46 | case platform[:name] 47 | when 'arch' 48 | config_filename = '/etc/dhcpd.conf' 49 | end 50 | end 51 | 52 | control 'DHCPD configuration' do 53 | title 'should be generated properly' 54 | 55 | describe file(config_filename) do 56 | it { should be_file } 57 | it { should be_owned_by 'root' } 58 | it { should be_grouped_into rootgroup } 59 | its('mode') { should cmp '0644' } 60 | its('content') do 61 | should include <<~CONFIG_FILE.chomp 62 | # dhcpd.conf 63 | # 64 | # SaltStack-generated configuration file for ISC dhcpd 65 | # 66 | 67 | # Customized dhcp options 68 | option auto-proxy-config code 252 = string; 69 | 70 | # option definitions common to all supported networks... 71 | option domain-name "example.org"; 72 | option domain-name-servers ns1.example.org, ns2.example.org; 73 | default-lease-time 600; 74 | max-lease-time 7200; 75 | 76 | #use-host-decl-names off; 77 | allow booting; 78 | allow bootp; 79 | deny unknown-clients; 80 | 81 | # LDAP Backend Configuration 82 | 83 | # Use this to enable / disable dynamic dns updates globally. 84 | #ddns-update-style none; 85 | #update-static-leases off; 86 | 87 | # If this DHCP server is the official DHCP server for the local 88 | # network, the authoritative directive should be uncommented. 89 | #authoritative; 90 | 91 | # Use this to send dhcp log messages to a different log file (you also 92 | # have to hack syslog.conf to complete the redirection). 93 | log-facility local7; 94 | # You can declare a class of clients and then do address allocation 95 | # based on that. The example below shows a case where all clients 96 | # in a certain class get addresses on the 10.17.224/24 subnet, and all 97 | # other clients get addresses on the 10.0.29/24 subnet. 98 | class "foo" { 99 | match if substring (option vendor-class-identifier, 0, 4) = "SUNW"; 100 | } 101 | failover peer "dhcp-failover" { 102 | primary; 103 | address 10.152.187.5; 104 | port 647; 105 | peer address 10.152.187.6; 106 | peer port 647; 107 | mclt 3600; 108 | split 128; 109 | } 110 | # No service will be given on this subnet, but declaring it helps the 111 | # DHCP server to understand the network topology. 112 | subnet 10.152.187.0 netmask 255.255.255.0 { 113 | pool { 114 | failover peer "dhcp-failover"; 115 | range 10.152.187.1 10.152.187.254; 116 | } 117 | } 118 | # This is a very basic subnet declaration. 119 | subnet 10.254.239.0 netmask 255.255.255.224 { 120 | range 10.254.239.10 10.254.239.20; 121 | option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org; 122 | } 123 | # This declaration allows BOOTP clients to get dynamic addresses, 124 | # which we don't really recommend. 125 | subnet 10.254.239.32 netmask 255.255.255.224 { 126 | range dynamic-bootp 10.254.239.40 10.254.239.60; 127 | option broadcast-address 10.254.239.31; 128 | option routers rtr-239-32-1.example.org; 129 | } 130 | # A slightly different configuration for an internal subnet. 131 | subnet 10.5.5.0 netmask 255.255.255.224 { 132 | range 10.5.5.26 10.5.5.30; 133 | option broadcast-address 10.5.5.31; 134 | option domain-name-servers ns1.internal.example.org; 135 | option domain-name "internal.example.org"; 136 | default-lease-time 600; 137 | max-lease-time 7200; 138 | option routers 10.5.5.1; 139 | 140 | # Hosts can be specified for subnets, taking subnets defaults 141 | host jake { 142 | hardware ethernet 08:00:a7:26:c0:a9; 143 | fixed-address 10.5.5.27; 144 | } 145 | } 146 | 147 | 148 | # Fixed IP addresses can also be specified for hosts. These addresses 149 | # should not also be listed as being available for dynamic assignment. 150 | # Hosts for which fixed IP addresses have been specified can boot using 151 | # BOOTP or DHCP. Hosts for which no fixed address is specified can only 152 | # be booted with DHCP, unless there is an address range on the subnet 153 | # to which a BOOTP client is connected which has the dynamic-bootp flag 154 | # set. 155 | host fantasia { 156 | hardware ethernet 08:00:07:26:c0:a5; 157 | fixed-address fantasia.fugue.com; 158 | } 159 | 160 | # The hostname for a host can be passed in the DHCP response. Using the 161 | # host_name key sets option host-name in the dhcpd configuration. 162 | host joe { 163 | hardware ethernet 08:00:2b:4c:29:32; 164 | fixed-address joe.fugue.com; 165 | option host-name "joe"; 166 | } 167 | 168 | # Hosts which require special configuration options can be listed in 169 | # host statements. If no address is specified, the address will be 170 | # allocated dynamically (if possible), but the host-specific information 171 | # will still come from the host declaration. 172 | host passacaglia { 173 | hardware ethernet 0:0:c0:5d:bd:95; 174 | filename "vmunix.passacaglia"; 175 | server-name "toccata.fugue.com"; 176 | } 177 | 178 | shared-network 224-29 { 179 | 180 | subnet 10.0.29.0 netmask 255.255.255.0 { 181 | option routers rtr-29.example.org; 182 | } 183 | 184 | subnet 10.17.224.0 netmask 255.255.255.0 { 185 | option routers rtr-224.example.org; 186 | } 187 | pool { 188 | allow members of "foo"; 189 | range 10.17.224.10 10.17.224.250; 190 | } 191 | pool { 192 | deny members of "foo"; 193 | range 10.0.29.10 10.0.29.230; 194 | } 195 | } 196 | CONFIG_FILE 197 | end 198 | end 199 | end 200 | 201 | control 'DHCPD service configuration' do 202 | title 'should be generated properly' 203 | 204 | only_if( 205 | 'the service configuration file is only available on the Debian, RedHat, ' \ 206 | 'Fedora & FreeBSD platform families' 207 | ) do 208 | %w[debian redhat fedora freebsd].include?(platform[:family]) 209 | end 210 | 211 | describe file(service_config_filename) do 212 | it { should be_file } 213 | it { should be_owned_by 'root' } 214 | it { should be_grouped_into rootgroup } 215 | its('mode') { should cmp '0644' } 216 | its('content') { should include service_config_file_contents } 217 | end 218 | end 219 | -------------------------------------------------------------------------------- /test/integration/default/controls/packages_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Overide by platform 4 | package_name = 5 | case platform[:family] 6 | when 'debian' 7 | 'isc-dhcp-server' 8 | when 'redhat' 9 | 'dhcp' 10 | when 'fedora', 'suse' 11 | 'dhcp-server' 12 | when 'freebsd' 13 | 'isc-dhcp43-server' 14 | when 'linux' 15 | case platform[:name] 16 | when 'arch' 17 | 'dhcp' 18 | end 19 | end 20 | 21 | control 'DHCPD package' do 22 | title 'should be installed' 23 | 24 | describe package(package_name) do 25 | it { should be_installed } 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /test/integration/default/controls/services_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Overide by platform 4 | service_name = 5 | case platform[:family] 6 | when 'debian' 7 | 'isc-dhcp-server' 8 | when 'redhat', 'fedora', 'suse' 9 | 'dhcpd' 10 | when 'freebsd' 11 | 'isc-dhcpd' 12 | when 'linux' 13 | case platform[:name] 14 | when 'arch' 15 | 'dhcpd4' 16 | end 17 | end 18 | 19 | control 'DHCPD service' do 20 | impact 0.5 21 | title 'should be installed but not enabled or running' 22 | 23 | describe service(service_name) do 24 | it { should be_installed } 25 | it { should_not be_enabled } 26 | it { should_not be_running } 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /test/integration/default/files/_mapdata/amazonlinux-1.yaml: -------------------------------------------------------------------------------- 1 | # yamllint disable rule:indentation rule:line-length 2 | # Amazon Linux AMI-2018 3 | --- 4 | values: 5 | allow: 6 | - booting 7 | - bootp 8 | arch: amd64 9 | authoritative: false 10 | classes: 11 | foo: 12 | comment: 'You can declare a class of clients and then do address allocation 13 | 14 | based on that. The example below shows a case where all clients 15 | 16 | in a certain class get addresses on the 10.17.224/24 subnet, and all 17 | 18 | other clients get addresses on the 10.0.29/24 subnet.' 19 | match: if substring (option vendor-class-identifier, 0, 4) = "SUNW" 20 | config: /etc/dhcp/dhcpd.conf 21 | customized_options: 22 | auto_proxy_config: 23 | code: 252 24 | type: string 25 | ddns_domainname: '' 26 | ddns_rev_domainname: '' 27 | ddns_update_style: '' 28 | default_lease_time: 600 29 | deny: unknown-clients 30 | domain_name: example.org 31 | domain_name_servers: 32 | - ns1.example.org 33 | - ns2.example.org 34 | domain_search: [] 35 | enable: false 36 | failover_peers: 37 | dhcp-failover: 38 | address: 10.152.187.5 39 | mclt: 3600 40 | peer_address: 10.152.187.6 41 | peer_port: 647 42 | port: 647 43 | primary: true 44 | split: 128 45 | get_lease_hostnames: '' 46 | hosts: 47 | fantasia: 48 | comment: 'Fixed IP addresses can also be specified for hosts. These addresses 49 | 50 | should not also be listed as being available for dynamic assignment. 51 | 52 | Hosts for which fixed IP addresses have been specified can boot using 53 | 54 | BOOTP or DHCP. Hosts for which no fixed address is specified can only 55 | 56 | be booted with DHCP, unless there is an address range on the subnet 57 | 58 | to which a BOOTP client is connected which has the dynamic-bootp flag 59 | 60 | set.' 61 | fixed_address: fantasia.fugue.com 62 | hardware: ethernet 08:00:07:26:c0:a5 63 | joe: 64 | comment: 'The hostname for a host can be passed in the DHCP response. Using 65 | the 66 | 67 | host_name key sets option host-name in the dhcpd configuration.' 68 | fixed_address: joe.fugue.com 69 | hardware: ethernet 08:00:2b:4c:29:32 70 | host_name: joe 71 | passacaglia: 72 | comment: 'Hosts which require special configuration options can be listed 73 | in 74 | 75 | host statements. If no address is specified, the address will be 76 | 77 | allocated dynamically (if possible), but the host-specific information 78 | 79 | will still come from the host declaration.' 80 | filename: vmunix.passacaglia 81 | hardware: ethernet 0:0:c0:5d:bd:95 82 | server_name: toccata.fugue.com 83 | keys: {} 84 | ldap_base_dn: '' 85 | ldap_debug_file: '' 86 | ldap_init_retry: 0 87 | ldap_method: '' 88 | ldap_password: '' 89 | ldap_port: '' 90 | ldap_server: '' 91 | ldap_ssl: '' 92 | ldap_tls_ca_dir: '' 93 | ldap_tls_ca_file: '' 94 | ldap_tls_cert: '' 95 | ldap_tls_ciphers: '' 96 | ldap_tls_crlcheck: '' 97 | ldap_tls_key: '' 98 | ldap_tls_randfile: '' 99 | ldap_tls_reqcert: '' 100 | ldap_username: '' 101 | listen_interfaces: 102 | - em1 103 | - em2 104 | log_facility: local7 105 | lookup: 106 | enable: false 107 | max_lease_time: 7200 108 | one_lease_per_client: '' 109 | routers: [] 110 | server: dhcp 111 | server_identifier: '' 112 | server_name: '' 113 | service: dhcpd 114 | service_config: /etc/systemd/system/dhcpd.service.d/override.conf 115 | shared_networks: 116 | 224-29: 117 | pools: 118 | - allow: members of "foo" 119 | range: 120 | - 10.17.224.10 121 | - 10.17.224.250 122 | - deny: members of "foo" 123 | range: 124 | - 10.0.29.10 125 | - 10.0.29.230 126 | subnets: 127 | 10.0.29.0: 128 | netmask: 255.255.255.0 129 | routers: rtr-29.example.org 130 | 10.17.224.0: 131 | netmask: 255.255.255.0 132 | routers: rtr-224.example.org 133 | subnet_mask: '' 134 | subnets: 135 | 10.152.187.0: 136 | comment: 'No service will be given on this subnet, but declaring it helps 137 | the 138 | 139 | DHCP server to understand the network topology.' 140 | netmask: 255.255.255.0 141 | pools: 142 | - failover_peer: dhcp-failover 143 | range: 144 | - 10.152.187.1 145 | - 10.152.187.254 146 | 10.254.239.0: 147 | comment: This is a very basic subnet declaration. 148 | netmask: 255.255.255.224 149 | range: 150 | - 10.254.239.10 151 | - 10.254.239.20 152 | routers: 153 | - rtr-239-0-1.example.org 154 | - rtr-239-0-2.example.org 155 | 10.254.239.32: 156 | broadcast_address: 10.254.239.31 157 | comment: 'This declaration allows BOOTP clients to get dynamic addresses, 158 | 159 | which we don''t really recommend.' 160 | dynamic_bootp: true 161 | netmask: 255.255.255.224 162 | range: 163 | - 10.254.239.40 164 | - 10.254.239.60 165 | routers: rtr-239-32-1.example.org 166 | 10.5.5.0: 167 | broadcast_address: 10.5.5.31 168 | comment: A slightly different configuration for an internal subnet. 169 | default_lease_time: 600 170 | domain_name: internal.example.org 171 | domain_name_servers: 172 | - ns1.internal.example.org 173 | hosts: 174 | jake: 175 | comment: Hosts can be specified for subnets, taking subnets defaults 176 | fixed_address: 10.5.5.27 177 | hardware: ethernet 08:00:a7:26:c0:a9 178 | max_lease_time: 7200 179 | netmask: 255.255.255.224 180 | range: 181 | - 10.5.5.26 182 | - 10.5.5.30 183 | routers: 184 | - 10.5.5.1 185 | update_static_leases: false 186 | use_host_decl_names: false 187 | zones: {} 188 | -------------------------------------------------------------------------------- /test/integration/default/files/_mapdata/amazonlinux-2.yaml: -------------------------------------------------------------------------------- 1 | # yamllint disable rule:indentation rule:line-length 2 | # Amazon Linux-2 3 | --- 4 | values: 5 | allow: 6 | - booting 7 | - bootp 8 | arch: amd64 9 | authoritative: false 10 | classes: 11 | foo: 12 | comment: 'You can declare a class of clients and then do address allocation 13 | 14 | based on that. The example below shows a case where all clients 15 | 16 | in a certain class get addresses on the 10.17.224/24 subnet, and all 17 | 18 | other clients get addresses on the 10.0.29/24 subnet.' 19 | match: if substring (option vendor-class-identifier, 0, 4) = "SUNW" 20 | config: /etc/dhcp/dhcpd.conf 21 | customized_options: 22 | auto_proxy_config: 23 | code: 252 24 | type: string 25 | ddns_domainname: '' 26 | ddns_rev_domainname: '' 27 | ddns_update_style: '' 28 | default_lease_time: 600 29 | deny: unknown-clients 30 | domain_name: example.org 31 | domain_name_servers: 32 | - ns1.example.org 33 | - ns2.example.org 34 | domain_search: [] 35 | enable: false 36 | failover_peers: 37 | dhcp-failover: 38 | address: 10.152.187.5 39 | mclt: 3600 40 | peer_address: 10.152.187.6 41 | peer_port: 647 42 | port: 647 43 | primary: true 44 | split: 128 45 | get_lease_hostnames: '' 46 | hosts: 47 | fantasia: 48 | comment: 'Fixed IP addresses can also be specified for hosts. These addresses 49 | 50 | should not also be listed as being available for dynamic assignment. 51 | 52 | Hosts for which fixed IP addresses have been specified can boot using 53 | 54 | BOOTP or DHCP. Hosts for which no fixed address is specified can only 55 | 56 | be booted with DHCP, unless there is an address range on the subnet 57 | 58 | to which a BOOTP client is connected which has the dynamic-bootp flag 59 | 60 | set.' 61 | fixed_address: fantasia.fugue.com 62 | hardware: ethernet 08:00:07:26:c0:a5 63 | joe: 64 | comment: 'The hostname for a host can be passed in the DHCP response. Using 65 | the 66 | 67 | host_name key sets option host-name in the dhcpd configuration.' 68 | fixed_address: joe.fugue.com 69 | hardware: ethernet 08:00:2b:4c:29:32 70 | host_name: joe 71 | passacaglia: 72 | comment: 'Hosts which require special configuration options can be listed 73 | in 74 | 75 | host statements. If no address is specified, the address will be 76 | 77 | allocated dynamically (if possible), but the host-specific information 78 | 79 | will still come from the host declaration.' 80 | filename: vmunix.passacaglia 81 | hardware: ethernet 0:0:c0:5d:bd:95 82 | server_name: toccata.fugue.com 83 | keys: {} 84 | ldap_base_dn: '' 85 | ldap_debug_file: '' 86 | ldap_init_retry: 0 87 | ldap_method: '' 88 | ldap_password: '' 89 | ldap_port: '' 90 | ldap_server: '' 91 | ldap_ssl: '' 92 | ldap_tls_ca_dir: '' 93 | ldap_tls_ca_file: '' 94 | ldap_tls_cert: '' 95 | ldap_tls_ciphers: '' 96 | ldap_tls_crlcheck: '' 97 | ldap_tls_key: '' 98 | ldap_tls_randfile: '' 99 | ldap_tls_reqcert: '' 100 | ldap_username: '' 101 | listen_interfaces: 102 | - em1 103 | - em2 104 | log_facility: local7 105 | lookup: 106 | enable: false 107 | max_lease_time: 7200 108 | one_lease_per_client: '' 109 | routers: [] 110 | server: dhcp 111 | server_identifier: '' 112 | server_name: '' 113 | service: dhcpd 114 | service_config: /etc/systemd/system/dhcpd.service.d/override.conf 115 | shared_networks: 116 | 224-29: 117 | pools: 118 | - allow: members of "foo" 119 | range: 120 | - 10.17.224.10 121 | - 10.17.224.250 122 | - deny: members of "foo" 123 | range: 124 | - 10.0.29.10 125 | - 10.0.29.230 126 | subnets: 127 | 10.0.29.0: 128 | netmask: 255.255.255.0 129 | routers: rtr-29.example.org 130 | 10.17.224.0: 131 | netmask: 255.255.255.0 132 | routers: rtr-224.example.org 133 | subnet_mask: '' 134 | subnets: 135 | 10.152.187.0: 136 | comment: 'No service will be given on this subnet, but declaring it helps 137 | the 138 | 139 | DHCP server to understand the network topology.' 140 | netmask: 255.255.255.0 141 | pools: 142 | - failover_peer: dhcp-failover 143 | range: 144 | - 10.152.187.1 145 | - 10.152.187.254 146 | 10.254.239.0: 147 | comment: This is a very basic subnet declaration. 148 | netmask: 255.255.255.224 149 | range: 150 | - 10.254.239.10 151 | - 10.254.239.20 152 | routers: 153 | - rtr-239-0-1.example.org 154 | - rtr-239-0-2.example.org 155 | 10.254.239.32: 156 | broadcast_address: 10.254.239.31 157 | comment: 'This declaration allows BOOTP clients to get dynamic addresses, 158 | 159 | which we don''t really recommend.' 160 | dynamic_bootp: true 161 | netmask: 255.255.255.224 162 | range: 163 | - 10.254.239.40 164 | - 10.254.239.60 165 | routers: rtr-239-32-1.example.org 166 | 10.5.5.0: 167 | broadcast_address: 10.5.5.31 168 | comment: A slightly different configuration for an internal subnet. 169 | default_lease_time: 600 170 | domain_name: internal.example.org 171 | domain_name_servers: 172 | - ns1.internal.example.org 173 | hosts: 174 | jake: 175 | comment: Hosts can be specified for subnets, taking subnets defaults 176 | fixed_address: 10.5.5.27 177 | hardware: ethernet 08:00:a7:26:c0:a9 178 | max_lease_time: 7200 179 | netmask: 255.255.255.224 180 | range: 181 | - 10.5.5.26 182 | - 10.5.5.30 183 | routers: 184 | - 10.5.5.1 185 | update_static_leases: false 186 | use_host_decl_names: false 187 | zones: {} 188 | -------------------------------------------------------------------------------- /test/integration/default/files/_mapdata/arch-base-latest.yaml: -------------------------------------------------------------------------------- 1 | # yamllint disable rule:indentation rule:line-length 2 | # Arch 3 | --- 4 | values: 5 | allow: 6 | - booting 7 | - bootp 8 | arch: amd64 9 | authoritative: false 10 | classes: 11 | foo: 12 | comment: 'You can declare a class of clients and then do address allocation 13 | 14 | based on that. The example below shows a case where all clients 15 | 16 | in a certain class get addresses on the 10.17.224/24 subnet, and all 17 | 18 | other clients get addresses on the 10.0.29/24 subnet.' 19 | match: if substring (option vendor-class-identifier, 0, 4) = "SUNW" 20 | config: /etc/dhcpd.conf 21 | customized_options: 22 | auto_proxy_config: 23 | code: 252 24 | type: string 25 | ddns_domainname: '' 26 | ddns_rev_domainname: '' 27 | ddns_update_style: '' 28 | default_lease_time: 600 29 | deny: unknown-clients 30 | domain_name: example.org 31 | domain_name_servers: 32 | - ns1.example.org 33 | - ns2.example.org 34 | domain_search: [] 35 | enable: false 36 | failover_peers: 37 | dhcp-failover: 38 | address: 10.152.187.5 39 | mclt: 3600 40 | peer_address: 10.152.187.6 41 | peer_port: 647 42 | port: 647 43 | primary: true 44 | split: 128 45 | get_lease_hostnames: '' 46 | hosts: 47 | fantasia: 48 | comment: 'Fixed IP addresses can also be specified for hosts. These addresses 49 | 50 | should not also be listed as being available for dynamic assignment. 51 | 52 | Hosts for which fixed IP addresses have been specified can boot using 53 | 54 | BOOTP or DHCP. Hosts for which no fixed address is specified can only 55 | 56 | be booted with DHCP, unless there is an address range on the subnet 57 | 58 | to which a BOOTP client is connected which has the dynamic-bootp flag 59 | 60 | set.' 61 | fixed_address: fantasia.fugue.com 62 | hardware: ethernet 08:00:07:26:c0:a5 63 | joe: 64 | comment: 'The hostname for a host can be passed in the DHCP response. Using 65 | the 66 | 67 | host_name key sets option host-name in the dhcpd configuration.' 68 | fixed_address: joe.fugue.com 69 | hardware: ethernet 08:00:2b:4c:29:32 70 | host_name: joe 71 | passacaglia: 72 | comment: 'Hosts which require special configuration options can be listed 73 | in 74 | 75 | host statements. If no address is specified, the address will be 76 | 77 | allocated dynamically (if possible), but the host-specific information 78 | 79 | will still come from the host declaration.' 80 | filename: vmunix.passacaglia 81 | hardware: ethernet 0:0:c0:5d:bd:95 82 | server_name: toccata.fugue.com 83 | keys: {} 84 | ldap_base_dn: '' 85 | ldap_debug_file: '' 86 | ldap_init_retry: 0 87 | ldap_method: '' 88 | ldap_password: '' 89 | ldap_port: '' 90 | ldap_server: '' 91 | ldap_ssl: '' 92 | ldap_tls_ca_dir: '' 93 | ldap_tls_ca_file: '' 94 | ldap_tls_cert: '' 95 | ldap_tls_ciphers: '' 96 | ldap_tls_crlcheck: '' 97 | ldap_tls_key: '' 98 | ldap_tls_randfile: '' 99 | ldap_tls_reqcert: '' 100 | ldap_username: '' 101 | listen_interfaces: 102 | - em1 103 | - em2 104 | log_facility: local7 105 | lookup: 106 | enable: false 107 | max_lease_time: 7200 108 | one_lease_per_client: '' 109 | routers: [] 110 | server: dhcp 111 | server_identifier: '' 112 | server_name: '' 113 | service: dhcpd4 114 | shared_networks: 115 | 224-29: 116 | pools: 117 | - allow: members of "foo" 118 | range: 119 | - 10.17.224.10 120 | - 10.17.224.250 121 | - deny: members of "foo" 122 | range: 123 | - 10.0.29.10 124 | - 10.0.29.230 125 | subnets: 126 | 10.0.29.0: 127 | netmask: 255.255.255.0 128 | routers: rtr-29.example.org 129 | 10.17.224.0: 130 | netmask: 255.255.255.0 131 | routers: rtr-224.example.org 132 | subnet_mask: '' 133 | subnets: 134 | 10.152.187.0: 135 | comment: 'No service will be given on this subnet, but declaring it helps 136 | the 137 | 138 | DHCP server to understand the network topology.' 139 | netmask: 255.255.255.0 140 | pools: 141 | - failover_peer: dhcp-failover 142 | range: 143 | - 10.152.187.1 144 | - 10.152.187.254 145 | 10.254.239.0: 146 | comment: This is a very basic subnet declaration. 147 | netmask: 255.255.255.224 148 | range: 149 | - 10.254.239.10 150 | - 10.254.239.20 151 | routers: 152 | - rtr-239-0-1.example.org 153 | - rtr-239-0-2.example.org 154 | 10.254.239.32: 155 | broadcast_address: 10.254.239.31 156 | comment: 'This declaration allows BOOTP clients to get dynamic addresses, 157 | 158 | which we don''t really recommend.' 159 | dynamic_bootp: true 160 | netmask: 255.255.255.224 161 | range: 162 | - 10.254.239.40 163 | - 10.254.239.60 164 | routers: rtr-239-32-1.example.org 165 | 10.5.5.0: 166 | broadcast_address: 10.5.5.31 167 | comment: A slightly different configuration for an internal subnet. 168 | default_lease_time: 600 169 | domain_name: internal.example.org 170 | domain_name_servers: 171 | - ns1.internal.example.org 172 | hosts: 173 | jake: 174 | comment: Hosts can be specified for subnets, taking subnets defaults 175 | fixed_address: 10.5.5.27 176 | hardware: ethernet 08:00:a7:26:c0:a9 177 | max_lease_time: 7200 178 | netmask: 255.255.255.224 179 | range: 180 | - 10.5.5.26 181 | - 10.5.5.30 182 | routers: 183 | - 10.5.5.1 184 | update_static_leases: false 185 | use_host_decl_names: false 186 | zones: {} 187 | -------------------------------------------------------------------------------- /test/integration/default/files/_mapdata/centos-7.yaml: -------------------------------------------------------------------------------- 1 | # yamllint disable rule:indentation rule:line-length 2 | # CentOS Linux-7 3 | --- 4 | values: 5 | allow: 6 | - booting 7 | - bootp 8 | arch: amd64 9 | authoritative: false 10 | classes: 11 | foo: 12 | comment: 'You can declare a class of clients and then do address allocation 13 | 14 | based on that. The example below shows a case where all clients 15 | 16 | in a certain class get addresses on the 10.17.224/24 subnet, and all 17 | 18 | other clients get addresses on the 10.0.29/24 subnet.' 19 | match: if substring (option vendor-class-identifier, 0, 4) = "SUNW" 20 | config: /etc/dhcp/dhcpd.conf 21 | customized_options: 22 | auto_proxy_config: 23 | code: 252 24 | type: string 25 | ddns_domainname: '' 26 | ddns_rev_domainname: '' 27 | ddns_update_style: '' 28 | default_lease_time: 600 29 | deny: unknown-clients 30 | domain_name: example.org 31 | domain_name_servers: 32 | - ns1.example.org 33 | - ns2.example.org 34 | domain_search: [] 35 | enable: false 36 | failover_peers: 37 | dhcp-failover: 38 | address: 10.152.187.5 39 | mclt: 3600 40 | peer_address: 10.152.187.6 41 | peer_port: 647 42 | port: 647 43 | primary: true 44 | split: 128 45 | get_lease_hostnames: '' 46 | hosts: 47 | fantasia: 48 | comment: 'Fixed IP addresses can also be specified for hosts. These addresses 49 | 50 | should not also be listed as being available for dynamic assignment. 51 | 52 | Hosts for which fixed IP addresses have been specified can boot using 53 | 54 | BOOTP or DHCP. Hosts for which no fixed address is specified can only 55 | 56 | be booted with DHCP, unless there is an address range on the subnet 57 | 58 | to which a BOOTP client is connected which has the dynamic-bootp flag 59 | 60 | set.' 61 | fixed_address: fantasia.fugue.com 62 | hardware: ethernet 08:00:07:26:c0:a5 63 | joe: 64 | comment: 'The hostname for a host can be passed in the DHCP response. Using 65 | the 66 | 67 | host_name key sets option host-name in the dhcpd configuration.' 68 | fixed_address: joe.fugue.com 69 | hardware: ethernet 08:00:2b:4c:29:32 70 | host_name: joe 71 | passacaglia: 72 | comment: 'Hosts which require special configuration options can be listed 73 | in 74 | 75 | host statements. If no address is specified, the address will be 76 | 77 | allocated dynamically (if possible), but the host-specific information 78 | 79 | will still come from the host declaration.' 80 | filename: vmunix.passacaglia 81 | hardware: ethernet 0:0:c0:5d:bd:95 82 | server_name: toccata.fugue.com 83 | keys: {} 84 | ldap_base_dn: '' 85 | ldap_debug_file: '' 86 | ldap_init_retry: 0 87 | ldap_method: '' 88 | ldap_password: '' 89 | ldap_port: '' 90 | ldap_server: '' 91 | ldap_ssl: '' 92 | ldap_tls_ca_dir: '' 93 | ldap_tls_ca_file: '' 94 | ldap_tls_cert: '' 95 | ldap_tls_ciphers: '' 96 | ldap_tls_crlcheck: '' 97 | ldap_tls_key: '' 98 | ldap_tls_randfile: '' 99 | ldap_tls_reqcert: '' 100 | ldap_username: '' 101 | listen_interfaces: 102 | - em1 103 | - em2 104 | log_facility: local7 105 | lookup: 106 | enable: false 107 | max_lease_time: 7200 108 | one_lease_per_client: '' 109 | routers: [] 110 | server: dhcp 111 | server_identifier: '' 112 | server_name: '' 113 | service: dhcpd 114 | service_config: /etc/systemd/system/dhcpd.service.d/override.conf 115 | shared_networks: 116 | 224-29: 117 | pools: 118 | - allow: members of "foo" 119 | range: 120 | - 10.17.224.10 121 | - 10.17.224.250 122 | - deny: members of "foo" 123 | range: 124 | - 10.0.29.10 125 | - 10.0.29.230 126 | subnets: 127 | 10.0.29.0: 128 | netmask: 255.255.255.0 129 | routers: rtr-29.example.org 130 | 10.17.224.0: 131 | netmask: 255.255.255.0 132 | routers: rtr-224.example.org 133 | subnet_mask: '' 134 | subnets: 135 | 10.152.187.0: 136 | comment: 'No service will be given on this subnet, but declaring it helps 137 | the 138 | 139 | DHCP server to understand the network topology.' 140 | netmask: 255.255.255.0 141 | pools: 142 | - failover_peer: dhcp-failover 143 | range: 144 | - 10.152.187.1 145 | - 10.152.187.254 146 | 10.254.239.0: 147 | comment: This is a very basic subnet declaration. 148 | netmask: 255.255.255.224 149 | range: 150 | - 10.254.239.10 151 | - 10.254.239.20 152 | routers: 153 | - rtr-239-0-1.example.org 154 | - rtr-239-0-2.example.org 155 | 10.254.239.32: 156 | broadcast_address: 10.254.239.31 157 | comment: 'This declaration allows BOOTP clients to get dynamic addresses, 158 | 159 | which we don''t really recommend.' 160 | dynamic_bootp: true 161 | netmask: 255.255.255.224 162 | range: 163 | - 10.254.239.40 164 | - 10.254.239.60 165 | routers: rtr-239-32-1.example.org 166 | 10.5.5.0: 167 | broadcast_address: 10.5.5.31 168 | comment: A slightly different configuration for an internal subnet. 169 | default_lease_time: 600 170 | domain_name: internal.example.org 171 | domain_name_servers: 172 | - ns1.internal.example.org 173 | hosts: 174 | jake: 175 | comment: Hosts can be specified for subnets, taking subnets defaults 176 | fixed_address: 10.5.5.27 177 | hardware: ethernet 08:00:a7:26:c0:a9 178 | max_lease_time: 7200 179 | netmask: 255.255.255.224 180 | range: 181 | - 10.5.5.26 182 | - 10.5.5.30 183 | routers: 184 | - 10.5.5.1 185 | update_static_leases: false 186 | use_host_decl_names: false 187 | zones: {} 188 | -------------------------------------------------------------------------------- /test/integration/default/files/_mapdata/centos-8.yaml: -------------------------------------------------------------------------------- 1 | # yamllint disable rule:indentation rule:line-length 2 | # CentOS Linux-8 3 | --- 4 | values: 5 | allow: 6 | - booting 7 | - bootp 8 | arch: amd64 9 | authoritative: false 10 | classes: 11 | foo: 12 | comment: 'You can declare a class of clients and then do address allocation 13 | 14 | based on that. The example below shows a case where all clients 15 | 16 | in a certain class get addresses on the 10.17.224/24 subnet, and all 17 | 18 | other clients get addresses on the 10.0.29/24 subnet.' 19 | match: if substring (option vendor-class-identifier, 0, 4) = "SUNW" 20 | config: /etc/dhcp/dhcpd.conf 21 | customized_options: 22 | auto_proxy_config: 23 | code: 252 24 | type: string 25 | ddns_domainname: '' 26 | ddns_rev_domainname: '' 27 | ddns_update_style: '' 28 | default_lease_time: 600 29 | deny: unknown-clients 30 | domain_name: example.org 31 | domain_name_servers: 32 | - ns1.example.org 33 | - ns2.example.org 34 | domain_search: [] 35 | enable: false 36 | failover_peers: 37 | dhcp-failover: 38 | address: 10.152.187.5 39 | mclt: 3600 40 | peer_address: 10.152.187.6 41 | peer_port: 647 42 | port: 647 43 | primary: true 44 | split: 128 45 | get_lease_hostnames: '' 46 | hosts: 47 | fantasia: 48 | comment: 'Fixed IP addresses can also be specified for hosts. These addresses 49 | 50 | should not also be listed as being available for dynamic assignment. 51 | 52 | Hosts for which fixed IP addresses have been specified can boot using 53 | 54 | BOOTP or DHCP. Hosts for which no fixed address is specified can only 55 | 56 | be booted with DHCP, unless there is an address range on the subnet 57 | 58 | to which a BOOTP client is connected which has the dynamic-bootp flag 59 | 60 | set.' 61 | fixed_address: fantasia.fugue.com 62 | hardware: ethernet 08:00:07:26:c0:a5 63 | joe: 64 | comment: 'The hostname for a host can be passed in the DHCP response. Using 65 | the 66 | 67 | host_name key sets option host-name in the dhcpd configuration.' 68 | fixed_address: joe.fugue.com 69 | hardware: ethernet 08:00:2b:4c:29:32 70 | host_name: joe 71 | passacaglia: 72 | comment: 'Hosts which require special configuration options can be listed 73 | in 74 | 75 | host statements. If no address is specified, the address will be 76 | 77 | allocated dynamically (if possible), but the host-specific information 78 | 79 | will still come from the host declaration.' 80 | filename: vmunix.passacaglia 81 | hardware: ethernet 0:0:c0:5d:bd:95 82 | server_name: toccata.fugue.com 83 | keys: {} 84 | ldap_base_dn: '' 85 | ldap_debug_file: '' 86 | ldap_init_retry: 0 87 | ldap_method: '' 88 | ldap_password: '' 89 | ldap_port: '' 90 | ldap_server: '' 91 | ldap_ssl: '' 92 | ldap_tls_ca_dir: '' 93 | ldap_tls_ca_file: '' 94 | ldap_tls_cert: '' 95 | ldap_tls_ciphers: '' 96 | ldap_tls_crlcheck: '' 97 | ldap_tls_key: '' 98 | ldap_tls_randfile: '' 99 | ldap_tls_reqcert: '' 100 | ldap_username: '' 101 | listen_interfaces: 102 | - em1 103 | - em2 104 | log_facility: local7 105 | lookup: 106 | enable: false 107 | max_lease_time: 7200 108 | one_lease_per_client: '' 109 | routers: [] 110 | server: dhcp 111 | server_identifier: '' 112 | server_name: '' 113 | service: dhcpd 114 | service_config: /etc/systemd/system/dhcpd.service.d/override.conf 115 | shared_networks: 116 | 224-29: 117 | pools: 118 | - allow: members of "foo" 119 | range: 120 | - 10.17.224.10 121 | - 10.17.224.250 122 | - deny: members of "foo" 123 | range: 124 | - 10.0.29.10 125 | - 10.0.29.230 126 | subnets: 127 | 10.0.29.0: 128 | netmask: 255.255.255.0 129 | routers: rtr-29.example.org 130 | 10.17.224.0: 131 | netmask: 255.255.255.0 132 | routers: rtr-224.example.org 133 | subnet_mask: '' 134 | subnets: 135 | 10.152.187.0: 136 | comment: 'No service will be given on this subnet, but declaring it helps 137 | the 138 | 139 | DHCP server to understand the network topology.' 140 | netmask: 255.255.255.0 141 | pools: 142 | - failover_peer: dhcp-failover 143 | range: 144 | - 10.152.187.1 145 | - 10.152.187.254 146 | 10.254.239.0: 147 | comment: This is a very basic subnet declaration. 148 | netmask: 255.255.255.224 149 | range: 150 | - 10.254.239.10 151 | - 10.254.239.20 152 | routers: 153 | - rtr-239-0-1.example.org 154 | - rtr-239-0-2.example.org 155 | 10.254.239.32: 156 | broadcast_address: 10.254.239.31 157 | comment: 'This declaration allows BOOTP clients to get dynamic addresses, 158 | 159 | which we don''t really recommend.' 160 | dynamic_bootp: true 161 | netmask: 255.255.255.224 162 | range: 163 | - 10.254.239.40 164 | - 10.254.239.60 165 | routers: rtr-239-32-1.example.org 166 | 10.5.5.0: 167 | broadcast_address: 10.5.5.31 168 | comment: A slightly different configuration for an internal subnet. 169 | default_lease_time: 600 170 | domain_name: internal.example.org 171 | domain_name_servers: 172 | - ns1.internal.example.org 173 | hosts: 174 | jake: 175 | comment: Hosts can be specified for subnets, taking subnets defaults 176 | fixed_address: 10.5.5.27 177 | hardware: ethernet 08:00:a7:26:c0:a9 178 | max_lease_time: 7200 179 | netmask: 255.255.255.224 180 | range: 181 | - 10.5.5.26 182 | - 10.5.5.30 183 | routers: 184 | - 10.5.5.1 185 | update_static_leases: false 186 | use_host_decl_names: false 187 | zones: {} 188 | -------------------------------------------------------------------------------- /test/integration/default/files/_mapdata/debian-10.yaml: -------------------------------------------------------------------------------- 1 | # yamllint disable rule:indentation rule:line-length 2 | # Debian-10 3 | --- 4 | values: 5 | allow: 6 | - booting 7 | - bootp 8 | arch: amd64 9 | authoritative: false 10 | classes: 11 | foo: 12 | comment: 'You can declare a class of clients and then do address allocation 13 | 14 | based on that. The example below shows a case where all clients 15 | 16 | in a certain class get addresses on the 10.17.224/24 subnet, and all 17 | 18 | other clients get addresses on the 10.0.29/24 subnet.' 19 | match: if substring (option vendor-class-identifier, 0, 4) = "SUNW" 20 | config: /etc/dhcp/dhcpd.conf 21 | customized_options: 22 | auto_proxy_config: 23 | code: 252 24 | type: string 25 | ddns_domainname: '' 26 | ddns_rev_domainname: '' 27 | ddns_update_style: '' 28 | default_lease_time: 600 29 | deny: unknown-clients 30 | domain_name: example.org 31 | domain_name_servers: 32 | - ns1.example.org 33 | - ns2.example.org 34 | domain_search: [] 35 | enable: false 36 | failover_peers: 37 | dhcp-failover: 38 | address: 10.152.187.5 39 | mclt: 3600 40 | peer_address: 10.152.187.6 41 | peer_port: 647 42 | port: 647 43 | primary: true 44 | split: 128 45 | get_lease_hostnames: '' 46 | hosts: 47 | fantasia: 48 | comment: 'Fixed IP addresses can also be specified for hosts. These addresses 49 | 50 | should not also be listed as being available for dynamic assignment. 51 | 52 | Hosts for which fixed IP addresses have been specified can boot using 53 | 54 | BOOTP or DHCP. Hosts for which no fixed address is specified can only 55 | 56 | be booted with DHCP, unless there is an address range on the subnet 57 | 58 | to which a BOOTP client is connected which has the dynamic-bootp flag 59 | 60 | set.' 61 | fixed_address: fantasia.fugue.com 62 | hardware: ethernet 08:00:07:26:c0:a5 63 | joe: 64 | comment: 'The hostname for a host can be passed in the DHCP response. Using 65 | the 66 | 67 | host_name key sets option host-name in the dhcpd configuration.' 68 | fixed_address: joe.fugue.com 69 | hardware: ethernet 08:00:2b:4c:29:32 70 | host_name: joe 71 | passacaglia: 72 | comment: 'Hosts which require special configuration options can be listed 73 | in 74 | 75 | host statements. If no address is specified, the address will be 76 | 77 | allocated dynamically (if possible), but the host-specific information 78 | 79 | will still come from the host declaration.' 80 | filename: vmunix.passacaglia 81 | hardware: ethernet 0:0:c0:5d:bd:95 82 | server_name: toccata.fugue.com 83 | keys: {} 84 | ldap_base_dn: '' 85 | ldap_debug_file: '' 86 | ldap_init_retry: 0 87 | ldap_method: '' 88 | ldap_password: '' 89 | ldap_port: '' 90 | ldap_server: '' 91 | ldap_ssl: '' 92 | ldap_tls_ca_dir: '' 93 | ldap_tls_ca_file: '' 94 | ldap_tls_cert: '' 95 | ldap_tls_ciphers: '' 96 | ldap_tls_crlcheck: '' 97 | ldap_tls_key: '' 98 | ldap_tls_randfile: '' 99 | ldap_tls_reqcert: '' 100 | ldap_username: '' 101 | listen_interfaces: 102 | - em1 103 | - em2 104 | log_facility: local7 105 | lookup: 106 | enable: false 107 | max_lease_time: 7200 108 | one_lease_per_client: '' 109 | routers: [] 110 | server: isc-dhcp-server 111 | server_identifier: '' 112 | server_name: '' 113 | service: isc-dhcp-server 114 | service_config: /etc/default/isc-dhcp-server 115 | shared_networks: 116 | 224-29: 117 | pools: 118 | - allow: members of "foo" 119 | range: 120 | - 10.17.224.10 121 | - 10.17.224.250 122 | - deny: members of "foo" 123 | range: 124 | - 10.0.29.10 125 | - 10.0.29.230 126 | subnets: 127 | 10.0.29.0: 128 | netmask: 255.255.255.0 129 | routers: rtr-29.example.org 130 | 10.17.224.0: 131 | netmask: 255.255.255.0 132 | routers: rtr-224.example.org 133 | subnet_mask: '' 134 | subnets: 135 | 10.152.187.0: 136 | comment: 'No service will be given on this subnet, but declaring it helps 137 | the 138 | 139 | DHCP server to understand the network topology.' 140 | netmask: 255.255.255.0 141 | pools: 142 | - failover_peer: dhcp-failover 143 | range: 144 | - 10.152.187.1 145 | - 10.152.187.254 146 | 10.254.239.0: 147 | comment: This is a very basic subnet declaration. 148 | netmask: 255.255.255.224 149 | range: 150 | - 10.254.239.10 151 | - 10.254.239.20 152 | routers: 153 | - rtr-239-0-1.example.org 154 | - rtr-239-0-2.example.org 155 | 10.254.239.32: 156 | broadcast_address: 10.254.239.31 157 | comment: 'This declaration allows BOOTP clients to get dynamic addresses, 158 | 159 | which we don''t really recommend.' 160 | dynamic_bootp: true 161 | netmask: 255.255.255.224 162 | range: 163 | - 10.254.239.40 164 | - 10.254.239.60 165 | routers: rtr-239-32-1.example.org 166 | 10.5.5.0: 167 | broadcast_address: 10.5.5.31 168 | comment: A slightly different configuration for an internal subnet. 169 | default_lease_time: 600 170 | domain_name: internal.example.org 171 | domain_name_servers: 172 | - ns1.internal.example.org 173 | hosts: 174 | jake: 175 | comment: Hosts can be specified for subnets, taking subnets defaults 176 | fixed_address: 10.5.5.27 177 | hardware: ethernet 08:00:a7:26:c0:a9 178 | max_lease_time: 7200 179 | netmask: 255.255.255.224 180 | range: 181 | - 10.5.5.26 182 | - 10.5.5.30 183 | routers: 184 | - 10.5.5.1 185 | update_static_leases: false 186 | use_host_decl_names: false 187 | zones: {} 188 | -------------------------------------------------------------------------------- /test/integration/default/files/_mapdata/debian-11.yaml: -------------------------------------------------------------------------------- 1 | # yamllint disable rule:indentation rule:line-length 2 | # Debian-11 3 | --- 4 | values: 5 | allow: 6 | - booting 7 | - bootp 8 | arch: amd64 9 | authoritative: false 10 | classes: 11 | foo: 12 | comment: 'You can declare a class of clients and then do address allocation 13 | 14 | based on that. The example below shows a case where all clients 15 | 16 | in a certain class get addresses on the 10.17.224/24 subnet, and all 17 | 18 | other clients get addresses on the 10.0.29/24 subnet.' 19 | match: if substring (option vendor-class-identifier, 0, 4) = "SUNW" 20 | config: /etc/dhcp/dhcpd.conf 21 | customized_options: 22 | auto_proxy_config: 23 | code: 252 24 | type: string 25 | ddns_domainname: '' 26 | ddns_rev_domainname: '' 27 | ddns_update_style: '' 28 | default_lease_time: 600 29 | deny: unknown-clients 30 | domain_name: example.org 31 | domain_name_servers: 32 | - ns1.example.org 33 | - ns2.example.org 34 | domain_search: [] 35 | enable: false 36 | failover_peers: 37 | dhcp-failover: 38 | address: 10.152.187.5 39 | mclt: 3600 40 | peer_address: 10.152.187.6 41 | peer_port: 647 42 | port: 647 43 | primary: true 44 | split: 128 45 | get_lease_hostnames: '' 46 | hosts: 47 | fantasia: 48 | comment: 'Fixed IP addresses can also be specified for hosts. These addresses 49 | 50 | should not also be listed as being available for dynamic assignment. 51 | 52 | Hosts for which fixed IP addresses have been specified can boot using 53 | 54 | BOOTP or DHCP. Hosts for which no fixed address is specified can only 55 | 56 | be booted with DHCP, unless there is an address range on the subnet 57 | 58 | to which a BOOTP client is connected which has the dynamic-bootp flag 59 | 60 | set.' 61 | fixed_address: fantasia.fugue.com 62 | hardware: ethernet 08:00:07:26:c0:a5 63 | joe: 64 | comment: 'The hostname for a host can be passed in the DHCP response. Using 65 | the 66 | 67 | host_name key sets option host-name in the dhcpd configuration.' 68 | fixed_address: joe.fugue.com 69 | hardware: ethernet 08:00:2b:4c:29:32 70 | host_name: joe 71 | passacaglia: 72 | comment: 'Hosts which require special configuration options can be listed 73 | in 74 | 75 | host statements. If no address is specified, the address will be 76 | 77 | allocated dynamically (if possible), but the host-specific information 78 | 79 | will still come from the host declaration.' 80 | filename: vmunix.passacaglia 81 | hardware: ethernet 0:0:c0:5d:bd:95 82 | server_name: toccata.fugue.com 83 | keys: {} 84 | ldap_base_dn: '' 85 | ldap_debug_file: '' 86 | ldap_init_retry: 0 87 | ldap_method: '' 88 | ldap_password: '' 89 | ldap_port: '' 90 | ldap_server: '' 91 | ldap_ssl: '' 92 | ldap_tls_ca_dir: '' 93 | ldap_tls_ca_file: '' 94 | ldap_tls_cert: '' 95 | ldap_tls_ciphers: '' 96 | ldap_tls_crlcheck: '' 97 | ldap_tls_key: '' 98 | ldap_tls_randfile: '' 99 | ldap_tls_reqcert: '' 100 | ldap_username: '' 101 | listen_interfaces: 102 | - em1 103 | - em2 104 | log_facility: local7 105 | lookup: 106 | enable: false 107 | max_lease_time: 7200 108 | one_lease_per_client: '' 109 | routers: [] 110 | server: isc-dhcp-server 111 | server_identifier: '' 112 | server_name: '' 113 | service: isc-dhcp-server 114 | service_config: /etc/default/isc-dhcp-server 115 | shared_networks: 116 | 224-29: 117 | pools: 118 | - allow: members of "foo" 119 | range: 120 | - 10.17.224.10 121 | - 10.17.224.250 122 | - deny: members of "foo" 123 | range: 124 | - 10.0.29.10 125 | - 10.0.29.230 126 | subnets: 127 | 10.0.29.0: 128 | netmask: 255.255.255.0 129 | routers: rtr-29.example.org 130 | 10.17.224.0: 131 | netmask: 255.255.255.0 132 | routers: rtr-224.example.org 133 | subnet_mask: '' 134 | subnets: 135 | 10.152.187.0: 136 | comment: 'No service will be given on this subnet, but declaring it helps 137 | the 138 | 139 | DHCP server to understand the network topology.' 140 | netmask: 255.255.255.0 141 | pools: 142 | - failover_peer: dhcp-failover 143 | range: 144 | - 10.152.187.1 145 | - 10.152.187.254 146 | 10.254.239.0: 147 | comment: This is a very basic subnet declaration. 148 | netmask: 255.255.255.224 149 | range: 150 | - 10.254.239.10 151 | - 10.254.239.20 152 | routers: 153 | - rtr-239-0-1.example.org 154 | - rtr-239-0-2.example.org 155 | 10.254.239.32: 156 | broadcast_address: 10.254.239.31 157 | comment: 'This declaration allows BOOTP clients to get dynamic addresses, 158 | 159 | which we don''t really recommend.' 160 | dynamic_bootp: true 161 | netmask: 255.255.255.224 162 | range: 163 | - 10.254.239.40 164 | - 10.254.239.60 165 | routers: rtr-239-32-1.example.org 166 | 10.5.5.0: 167 | broadcast_address: 10.5.5.31 168 | comment: A slightly different configuration for an internal subnet. 169 | default_lease_time: 600 170 | domain_name: internal.example.org 171 | domain_name_servers: 172 | - ns1.internal.example.org 173 | hosts: 174 | jake: 175 | comment: Hosts can be specified for subnets, taking subnets defaults 176 | fixed_address: 10.5.5.27 177 | hardware: ethernet 08:00:a7:26:c0:a9 178 | max_lease_time: 7200 179 | netmask: 255.255.255.224 180 | range: 181 | - 10.5.5.26 182 | - 10.5.5.30 183 | routers: 184 | - 10.5.5.1 185 | update_static_leases: false 186 | use_host_decl_names: false 187 | zones: {} 188 | -------------------------------------------------------------------------------- /test/integration/default/files/_mapdata/debian-9.yaml: -------------------------------------------------------------------------------- 1 | # yamllint disable rule:indentation rule:line-length 2 | # Debian-9 3 | --- 4 | values: 5 | allow: 6 | - booting 7 | - bootp 8 | arch: amd64 9 | authoritative: false 10 | classes: 11 | foo: 12 | comment: 'You can declare a class of clients and then do address allocation 13 | 14 | based on that. The example below shows a case where all clients 15 | 16 | in a certain class get addresses on the 10.17.224/24 subnet, and all 17 | 18 | other clients get addresses on the 10.0.29/24 subnet.' 19 | match: if substring (option vendor-class-identifier, 0, 4) = "SUNW" 20 | config: /etc/dhcp/dhcpd.conf 21 | customized_options: 22 | auto_proxy_config: 23 | code: 252 24 | type: string 25 | ddns_domainname: '' 26 | ddns_rev_domainname: '' 27 | ddns_update_style: '' 28 | default_lease_time: 600 29 | deny: unknown-clients 30 | domain_name: example.org 31 | domain_name_servers: 32 | - ns1.example.org 33 | - ns2.example.org 34 | domain_search: [] 35 | enable: false 36 | failover_peers: 37 | dhcp-failover: 38 | address: 10.152.187.5 39 | mclt: 3600 40 | peer_address: 10.152.187.6 41 | peer_port: 647 42 | port: 647 43 | primary: true 44 | split: 128 45 | get_lease_hostnames: '' 46 | hosts: 47 | fantasia: 48 | comment: 'Fixed IP addresses can also be specified for hosts. These addresses 49 | 50 | should not also be listed as being available for dynamic assignment. 51 | 52 | Hosts for which fixed IP addresses have been specified can boot using 53 | 54 | BOOTP or DHCP. Hosts for which no fixed address is specified can only 55 | 56 | be booted with DHCP, unless there is an address range on the subnet 57 | 58 | to which a BOOTP client is connected which has the dynamic-bootp flag 59 | 60 | set.' 61 | fixed_address: fantasia.fugue.com 62 | hardware: ethernet 08:00:07:26:c0:a5 63 | joe: 64 | comment: 'The hostname for a host can be passed in the DHCP response. Using 65 | the 66 | 67 | host_name key sets option host-name in the dhcpd configuration.' 68 | fixed_address: joe.fugue.com 69 | hardware: ethernet 08:00:2b:4c:29:32 70 | host_name: joe 71 | passacaglia: 72 | comment: 'Hosts which require special configuration options can be listed 73 | in 74 | 75 | host statements. If no address is specified, the address will be 76 | 77 | allocated dynamically (if possible), but the host-specific information 78 | 79 | will still come from the host declaration.' 80 | filename: vmunix.passacaglia 81 | hardware: ethernet 0:0:c0:5d:bd:95 82 | server_name: toccata.fugue.com 83 | keys: {} 84 | ldap_base_dn: '' 85 | ldap_debug_file: '' 86 | ldap_init_retry: 0 87 | ldap_method: '' 88 | ldap_password: '' 89 | ldap_port: '' 90 | ldap_server: '' 91 | ldap_ssl: '' 92 | ldap_tls_ca_dir: '' 93 | ldap_tls_ca_file: '' 94 | ldap_tls_cert: '' 95 | ldap_tls_ciphers: '' 96 | ldap_tls_crlcheck: '' 97 | ldap_tls_key: '' 98 | ldap_tls_randfile: '' 99 | ldap_tls_reqcert: '' 100 | ldap_username: '' 101 | listen_interfaces: 102 | - em1 103 | - em2 104 | log_facility: local7 105 | lookup: 106 | enable: false 107 | max_lease_time: 7200 108 | one_lease_per_client: '' 109 | routers: [] 110 | server: isc-dhcp-server 111 | server_identifier: '' 112 | server_name: '' 113 | service: isc-dhcp-server 114 | service_config: /etc/default/isc-dhcp-server 115 | shared_networks: 116 | 224-29: 117 | pools: 118 | - allow: members of "foo" 119 | range: 120 | - 10.17.224.10 121 | - 10.17.224.250 122 | - deny: members of "foo" 123 | range: 124 | - 10.0.29.10 125 | - 10.0.29.230 126 | subnets: 127 | 10.0.29.0: 128 | netmask: 255.255.255.0 129 | routers: rtr-29.example.org 130 | 10.17.224.0: 131 | netmask: 255.255.255.0 132 | routers: rtr-224.example.org 133 | subnet_mask: '' 134 | subnets: 135 | 10.152.187.0: 136 | comment: 'No service will be given on this subnet, but declaring it helps 137 | the 138 | 139 | DHCP server to understand the network topology.' 140 | netmask: 255.255.255.0 141 | pools: 142 | - failover_peer: dhcp-failover 143 | range: 144 | - 10.152.187.1 145 | - 10.152.187.254 146 | 10.254.239.0: 147 | comment: This is a very basic subnet declaration. 148 | netmask: 255.255.255.224 149 | range: 150 | - 10.254.239.10 151 | - 10.254.239.20 152 | routers: 153 | - rtr-239-0-1.example.org 154 | - rtr-239-0-2.example.org 155 | 10.254.239.32: 156 | broadcast_address: 10.254.239.31 157 | comment: 'This declaration allows BOOTP clients to get dynamic addresses, 158 | 159 | which we don''t really recommend.' 160 | dynamic_bootp: true 161 | netmask: 255.255.255.224 162 | range: 163 | - 10.254.239.40 164 | - 10.254.239.60 165 | routers: rtr-239-32-1.example.org 166 | 10.5.5.0: 167 | broadcast_address: 10.5.5.31 168 | comment: A slightly different configuration for an internal subnet. 169 | default_lease_time: 600 170 | domain_name: internal.example.org 171 | domain_name_servers: 172 | - ns1.internal.example.org 173 | hosts: 174 | jake: 175 | comment: Hosts can be specified for subnets, taking subnets defaults 176 | fixed_address: 10.5.5.27 177 | hardware: ethernet 08:00:a7:26:c0:a9 178 | max_lease_time: 7200 179 | netmask: 255.255.255.224 180 | range: 181 | - 10.5.5.26 182 | - 10.5.5.30 183 | routers: 184 | - 10.5.5.1 185 | update_static_leases: false 186 | use_host_decl_names: false 187 | zones: {} 188 | -------------------------------------------------------------------------------- /test/integration/default/files/_mapdata/fedora-31.yaml: -------------------------------------------------------------------------------- 1 | # yamllint disable rule:indentation rule:line-length 2 | # Fedora-31 3 | --- 4 | values: 5 | allow: 6 | - booting 7 | - bootp 8 | arch: amd64 9 | authoritative: false 10 | classes: 11 | foo: 12 | comment: 'You can declare a class of clients and then do address allocation 13 | 14 | based on that. The example below shows a case where all clients 15 | 16 | in a certain class get addresses on the 10.17.224/24 subnet, and all 17 | 18 | other clients get addresses on the 10.0.29/24 subnet.' 19 | match: if substring (option vendor-class-identifier, 0, 4) = "SUNW" 20 | config: /etc/dhcp/dhcpd.conf 21 | customized_options: 22 | auto_proxy_config: 23 | code: 252 24 | type: string 25 | ddns_domainname: '' 26 | ddns_rev_domainname: '' 27 | ddns_update_style: '' 28 | default_lease_time: 600 29 | deny: unknown-clients 30 | domain_name: example.org 31 | domain_name_servers: 32 | - ns1.example.org 33 | - ns2.example.org 34 | domain_search: [] 35 | enable: false 36 | failover_peers: 37 | dhcp-failover: 38 | address: 10.152.187.5 39 | mclt: 3600 40 | peer_address: 10.152.187.6 41 | peer_port: 647 42 | port: 647 43 | primary: true 44 | split: 128 45 | get_lease_hostnames: '' 46 | hosts: 47 | fantasia: 48 | comment: 'Fixed IP addresses can also be specified for hosts. These addresses 49 | 50 | should not also be listed as being available for dynamic assignment. 51 | 52 | Hosts for which fixed IP addresses have been specified can boot using 53 | 54 | BOOTP or DHCP. Hosts for which no fixed address is specified can only 55 | 56 | be booted with DHCP, unless there is an address range on the subnet 57 | 58 | to which a BOOTP client is connected which has the dynamic-bootp flag 59 | 60 | set.' 61 | fixed_address: fantasia.fugue.com 62 | hardware: ethernet 08:00:07:26:c0:a5 63 | joe: 64 | comment: 'The hostname for a host can be passed in the DHCP response. Using 65 | the 66 | 67 | host_name key sets option host-name in the dhcpd configuration.' 68 | fixed_address: joe.fugue.com 69 | hardware: ethernet 08:00:2b:4c:29:32 70 | host_name: joe 71 | passacaglia: 72 | comment: 'Hosts which require special configuration options can be listed 73 | in 74 | 75 | host statements. If no address is specified, the address will be 76 | 77 | allocated dynamically (if possible), but the host-specific information 78 | 79 | will still come from the host declaration.' 80 | filename: vmunix.passacaglia 81 | hardware: ethernet 0:0:c0:5d:bd:95 82 | server_name: toccata.fugue.com 83 | keys: {} 84 | ldap_base_dn: '' 85 | ldap_debug_file: '' 86 | ldap_init_retry: 0 87 | ldap_method: '' 88 | ldap_password: '' 89 | ldap_port: '' 90 | ldap_server: '' 91 | ldap_ssl: '' 92 | ldap_tls_ca_dir: '' 93 | ldap_tls_ca_file: '' 94 | ldap_tls_cert: '' 95 | ldap_tls_ciphers: '' 96 | ldap_tls_crlcheck: '' 97 | ldap_tls_key: '' 98 | ldap_tls_randfile: '' 99 | ldap_tls_reqcert: '' 100 | ldap_username: '' 101 | listen_interfaces: 102 | - em1 103 | - em2 104 | log_facility: local7 105 | lookup: 106 | enable: false 107 | max_lease_time: 7200 108 | one_lease_per_client: '' 109 | routers: [] 110 | server: dhcp-server 111 | server_identifier: '' 112 | server_name: '' 113 | service: dhcpd 114 | service_config: /etc/systemd/system/dhcpd.service.d/override.conf 115 | shared_networks: 116 | 224-29: 117 | pools: 118 | - allow: members of "foo" 119 | range: 120 | - 10.17.224.10 121 | - 10.17.224.250 122 | - deny: members of "foo" 123 | range: 124 | - 10.0.29.10 125 | - 10.0.29.230 126 | subnets: 127 | 10.0.29.0: 128 | netmask: 255.255.255.0 129 | routers: rtr-29.example.org 130 | 10.17.224.0: 131 | netmask: 255.255.255.0 132 | routers: rtr-224.example.org 133 | subnet_mask: '' 134 | subnets: 135 | 10.152.187.0: 136 | comment: 'No service will be given on this subnet, but declaring it helps 137 | the 138 | 139 | DHCP server to understand the network topology.' 140 | netmask: 255.255.255.0 141 | pools: 142 | - failover_peer: dhcp-failover 143 | range: 144 | - 10.152.187.1 145 | - 10.152.187.254 146 | 10.254.239.0: 147 | comment: This is a very basic subnet declaration. 148 | netmask: 255.255.255.224 149 | range: 150 | - 10.254.239.10 151 | - 10.254.239.20 152 | routers: 153 | - rtr-239-0-1.example.org 154 | - rtr-239-0-2.example.org 155 | 10.254.239.32: 156 | broadcast_address: 10.254.239.31 157 | comment: 'This declaration allows BOOTP clients to get dynamic addresses, 158 | 159 | which we don''t really recommend.' 160 | dynamic_bootp: true 161 | netmask: 255.255.255.224 162 | range: 163 | - 10.254.239.40 164 | - 10.254.239.60 165 | routers: rtr-239-32-1.example.org 166 | 10.5.5.0: 167 | broadcast_address: 10.5.5.31 168 | comment: A slightly different configuration for an internal subnet. 169 | default_lease_time: 600 170 | domain_name: internal.example.org 171 | domain_name_servers: 172 | - ns1.internal.example.org 173 | hosts: 174 | jake: 175 | comment: Hosts can be specified for subnets, taking subnets defaults 176 | fixed_address: 10.5.5.27 177 | hardware: ethernet 08:00:a7:26:c0:a9 178 | max_lease_time: 7200 179 | netmask: 255.255.255.224 180 | range: 181 | - 10.5.5.26 182 | - 10.5.5.30 183 | routers: 184 | - 10.5.5.1 185 | update_static_leases: false 186 | use_host_decl_names: false 187 | zones: {} 188 | -------------------------------------------------------------------------------- /test/integration/default/files/_mapdata/fedora-32.yaml: -------------------------------------------------------------------------------- 1 | # yamllint disable rule:indentation rule:line-length 2 | # Fedora-32 3 | --- 4 | values: 5 | allow: 6 | - booting 7 | - bootp 8 | arch: amd64 9 | authoritative: false 10 | classes: 11 | foo: 12 | comment: 'You can declare a class of clients and then do address allocation 13 | 14 | based on that. The example below shows a case where all clients 15 | 16 | in a certain class get addresses on the 10.17.224/24 subnet, and all 17 | 18 | other clients get addresses on the 10.0.29/24 subnet.' 19 | match: if substring (option vendor-class-identifier, 0, 4) = "SUNW" 20 | config: /etc/dhcp/dhcpd.conf 21 | customized_options: 22 | auto_proxy_config: 23 | code: 252 24 | type: string 25 | ddns_domainname: '' 26 | ddns_rev_domainname: '' 27 | ddns_update_style: '' 28 | default_lease_time: 600 29 | deny: unknown-clients 30 | domain_name: example.org 31 | domain_name_servers: 32 | - ns1.example.org 33 | - ns2.example.org 34 | domain_search: [] 35 | enable: false 36 | failover_peers: 37 | dhcp-failover: 38 | address: 10.152.187.5 39 | mclt: 3600 40 | peer_address: 10.152.187.6 41 | peer_port: 647 42 | port: 647 43 | primary: true 44 | split: 128 45 | get_lease_hostnames: '' 46 | hosts: 47 | fantasia: 48 | comment: 'Fixed IP addresses can also be specified for hosts. These addresses 49 | 50 | should not also be listed as being available for dynamic assignment. 51 | 52 | Hosts for which fixed IP addresses have been specified can boot using 53 | 54 | BOOTP or DHCP. Hosts for which no fixed address is specified can only 55 | 56 | be booted with DHCP, unless there is an address range on the subnet 57 | 58 | to which a BOOTP client is connected which has the dynamic-bootp flag 59 | 60 | set.' 61 | fixed_address: fantasia.fugue.com 62 | hardware: ethernet 08:00:07:26:c0:a5 63 | joe: 64 | comment: 'The hostname for a host can be passed in the DHCP response. Using 65 | the 66 | 67 | host_name key sets option host-name in the dhcpd configuration.' 68 | fixed_address: joe.fugue.com 69 | hardware: ethernet 08:00:2b:4c:29:32 70 | host_name: joe 71 | passacaglia: 72 | comment: 'Hosts which require special configuration options can be listed 73 | in 74 | 75 | host statements. If no address is specified, the address will be 76 | 77 | allocated dynamically (if possible), but the host-specific information 78 | 79 | will still come from the host declaration.' 80 | filename: vmunix.passacaglia 81 | hardware: ethernet 0:0:c0:5d:bd:95 82 | server_name: toccata.fugue.com 83 | keys: {} 84 | ldap_base_dn: '' 85 | ldap_debug_file: '' 86 | ldap_init_retry: 0 87 | ldap_method: '' 88 | ldap_password: '' 89 | ldap_port: '' 90 | ldap_server: '' 91 | ldap_ssl: '' 92 | ldap_tls_ca_dir: '' 93 | ldap_tls_ca_file: '' 94 | ldap_tls_cert: '' 95 | ldap_tls_ciphers: '' 96 | ldap_tls_crlcheck: '' 97 | ldap_tls_key: '' 98 | ldap_tls_randfile: '' 99 | ldap_tls_reqcert: '' 100 | ldap_username: '' 101 | listen_interfaces: 102 | - em1 103 | - em2 104 | log_facility: local7 105 | lookup: 106 | enable: false 107 | max_lease_time: 7200 108 | one_lease_per_client: '' 109 | routers: [] 110 | server: dhcp-server 111 | server_identifier: '' 112 | server_name: '' 113 | service: dhcpd 114 | service_config: /etc/systemd/system/dhcpd.service.d/override.conf 115 | shared_networks: 116 | 224-29: 117 | pools: 118 | - allow: members of "foo" 119 | range: 120 | - 10.17.224.10 121 | - 10.17.224.250 122 | - deny: members of "foo" 123 | range: 124 | - 10.0.29.10 125 | - 10.0.29.230 126 | subnets: 127 | 10.0.29.0: 128 | netmask: 255.255.255.0 129 | routers: rtr-29.example.org 130 | 10.17.224.0: 131 | netmask: 255.255.255.0 132 | routers: rtr-224.example.org 133 | subnet_mask: '' 134 | subnets: 135 | 10.152.187.0: 136 | comment: 'No service will be given on this subnet, but declaring it helps 137 | the 138 | 139 | DHCP server to understand the network topology.' 140 | netmask: 255.255.255.0 141 | pools: 142 | - failover_peer: dhcp-failover 143 | range: 144 | - 10.152.187.1 145 | - 10.152.187.254 146 | 10.254.239.0: 147 | comment: This is a very basic subnet declaration. 148 | netmask: 255.255.255.224 149 | range: 150 | - 10.254.239.10 151 | - 10.254.239.20 152 | routers: 153 | - rtr-239-0-1.example.org 154 | - rtr-239-0-2.example.org 155 | 10.254.239.32: 156 | broadcast_address: 10.254.239.31 157 | comment: 'This declaration allows BOOTP clients to get dynamic addresses, 158 | 159 | which we don''t really recommend.' 160 | dynamic_bootp: true 161 | netmask: 255.255.255.224 162 | range: 163 | - 10.254.239.40 164 | - 10.254.239.60 165 | routers: rtr-239-32-1.example.org 166 | 10.5.5.0: 167 | broadcast_address: 10.5.5.31 168 | comment: A slightly different configuration for an internal subnet. 169 | default_lease_time: 600 170 | domain_name: internal.example.org 171 | domain_name_servers: 172 | - ns1.internal.example.org 173 | hosts: 174 | jake: 175 | comment: Hosts can be specified for subnets, taking subnets defaults 176 | fixed_address: 10.5.5.27 177 | hardware: ethernet 08:00:a7:26:c0:a9 178 | max_lease_time: 7200 179 | netmask: 255.255.255.224 180 | range: 181 | - 10.5.5.26 182 | - 10.5.5.30 183 | routers: 184 | - 10.5.5.1 185 | update_static_leases: false 186 | use_host_decl_names: false 187 | zones: {} 188 | -------------------------------------------------------------------------------- /test/integration/default/files/_mapdata/fedora-33.yaml: -------------------------------------------------------------------------------- 1 | # yamllint disable rule:indentation rule:line-length 2 | # Fedora-33 3 | --- 4 | values: 5 | allow: 6 | - booting 7 | - bootp 8 | arch: amd64 9 | authoritative: false 10 | classes: 11 | foo: 12 | comment: 'You can declare a class of clients and then do address allocation 13 | 14 | based on that. The example below shows a case where all clients 15 | 16 | in a certain class get addresses on the 10.17.224/24 subnet, and all 17 | 18 | other clients get addresses on the 10.0.29/24 subnet.' 19 | match: if substring (option vendor-class-identifier, 0, 4) = "SUNW" 20 | config: /etc/dhcp/dhcpd.conf 21 | customized_options: 22 | auto_proxy_config: 23 | code: 252 24 | type: string 25 | ddns_domainname: '' 26 | ddns_rev_domainname: '' 27 | ddns_update_style: '' 28 | default_lease_time: 600 29 | deny: unknown-clients 30 | domain_name: example.org 31 | domain_name_servers: 32 | - ns1.example.org 33 | - ns2.example.org 34 | domain_search: [] 35 | enable: false 36 | failover_peers: 37 | dhcp-failover: 38 | address: 10.152.187.5 39 | mclt: 3600 40 | peer_address: 10.152.187.6 41 | peer_port: 647 42 | port: 647 43 | primary: true 44 | split: 128 45 | get_lease_hostnames: '' 46 | hosts: 47 | fantasia: 48 | comment: 'Fixed IP addresses can also be specified for hosts. These addresses 49 | 50 | should not also be listed as being available for dynamic assignment. 51 | 52 | Hosts for which fixed IP addresses have been specified can boot using 53 | 54 | BOOTP or DHCP. Hosts for which no fixed address is specified can only 55 | 56 | be booted with DHCP, unless there is an address range on the subnet 57 | 58 | to which a BOOTP client is connected which has the dynamic-bootp flag 59 | 60 | set.' 61 | fixed_address: fantasia.fugue.com 62 | hardware: ethernet 08:00:07:26:c0:a5 63 | joe: 64 | comment: 'The hostname for a host can be passed in the DHCP response. Using 65 | the 66 | 67 | host_name key sets option host-name in the dhcpd configuration.' 68 | fixed_address: joe.fugue.com 69 | hardware: ethernet 08:00:2b:4c:29:32 70 | host_name: joe 71 | passacaglia: 72 | comment: 'Hosts which require special configuration options can be listed 73 | in 74 | 75 | host statements. If no address is specified, the address will be 76 | 77 | allocated dynamically (if possible), but the host-specific information 78 | 79 | will still come from the host declaration.' 80 | filename: vmunix.passacaglia 81 | hardware: ethernet 0:0:c0:5d:bd:95 82 | server_name: toccata.fugue.com 83 | keys: {} 84 | ldap_base_dn: '' 85 | ldap_debug_file: '' 86 | ldap_init_retry: 0 87 | ldap_method: '' 88 | ldap_password: '' 89 | ldap_port: '' 90 | ldap_server: '' 91 | ldap_ssl: '' 92 | ldap_tls_ca_dir: '' 93 | ldap_tls_ca_file: '' 94 | ldap_tls_cert: '' 95 | ldap_tls_ciphers: '' 96 | ldap_tls_crlcheck: '' 97 | ldap_tls_key: '' 98 | ldap_tls_randfile: '' 99 | ldap_tls_reqcert: '' 100 | ldap_username: '' 101 | listen_interfaces: 102 | - em1 103 | - em2 104 | log_facility: local7 105 | lookup: 106 | enable: false 107 | max_lease_time: 7200 108 | one_lease_per_client: '' 109 | routers: [] 110 | server: dhcp-server 111 | server_identifier: '' 112 | server_name: '' 113 | service: dhcpd 114 | service_config: /etc/systemd/system/dhcpd.service.d/override.conf 115 | shared_networks: 116 | 224-29: 117 | pools: 118 | - allow: members of "foo" 119 | range: 120 | - 10.17.224.10 121 | - 10.17.224.250 122 | - deny: members of "foo" 123 | range: 124 | - 10.0.29.10 125 | - 10.0.29.230 126 | subnets: 127 | 10.0.29.0: 128 | netmask: 255.255.255.0 129 | routers: rtr-29.example.org 130 | 10.17.224.0: 131 | netmask: 255.255.255.0 132 | routers: rtr-224.example.org 133 | subnet_mask: '' 134 | subnets: 135 | 10.152.187.0: 136 | comment: 'No service will be given on this subnet, but declaring it helps 137 | the 138 | 139 | DHCP server to understand the network topology.' 140 | netmask: 255.255.255.0 141 | pools: 142 | - failover_peer: dhcp-failover 143 | range: 144 | - 10.152.187.1 145 | - 10.152.187.254 146 | 10.254.239.0: 147 | comment: This is a very basic subnet declaration. 148 | netmask: 255.255.255.224 149 | range: 150 | - 10.254.239.10 151 | - 10.254.239.20 152 | routers: 153 | - rtr-239-0-1.example.org 154 | - rtr-239-0-2.example.org 155 | 10.254.239.32: 156 | broadcast_address: 10.254.239.31 157 | comment: 'This declaration allows BOOTP clients to get dynamic addresses, 158 | 159 | which we don''t really recommend.' 160 | dynamic_bootp: true 161 | netmask: 255.255.255.224 162 | range: 163 | - 10.254.239.40 164 | - 10.254.239.60 165 | routers: rtr-239-32-1.example.org 166 | 10.5.5.0: 167 | broadcast_address: 10.5.5.31 168 | comment: A slightly different configuration for an internal subnet. 169 | default_lease_time: 600 170 | domain_name: internal.example.org 171 | domain_name_servers: 172 | - ns1.internal.example.org 173 | hosts: 174 | jake: 175 | comment: Hosts can be specified for subnets, taking subnets defaults 176 | fixed_address: 10.5.5.27 177 | hardware: ethernet 08:00:a7:26:c0:a9 178 | max_lease_time: 7200 179 | netmask: 255.255.255.224 180 | range: 181 | - 10.5.5.26 182 | - 10.5.5.30 183 | routers: 184 | - 10.5.5.1 185 | update_static_leases: false 186 | use_host_decl_names: false 187 | zones: {} 188 | -------------------------------------------------------------------------------- /test/integration/default/files/_mapdata/fedora-34.yaml: -------------------------------------------------------------------------------- 1 | # yamllint disable rule:indentation rule:line-length 2 | # Fedora-34 3 | --- 4 | values: 5 | allow: 6 | - booting 7 | - bootp 8 | arch: amd64 9 | authoritative: false 10 | classes: 11 | foo: 12 | comment: 'You can declare a class of clients and then do address allocation 13 | 14 | based on that. The example below shows a case where all clients 15 | 16 | in a certain class get addresses on the 10.17.224/24 subnet, and all 17 | 18 | other clients get addresses on the 10.0.29/24 subnet.' 19 | match: if substring (option vendor-class-identifier, 0, 4) = "SUNW" 20 | config: /etc/dhcp/dhcpd.conf 21 | customized_options: 22 | auto_proxy_config: 23 | code: 252 24 | type: string 25 | ddns_domainname: '' 26 | ddns_rev_domainname: '' 27 | ddns_update_style: '' 28 | default_lease_time: 600 29 | deny: unknown-clients 30 | domain_name: example.org 31 | domain_name_servers: 32 | - ns1.example.org 33 | - ns2.example.org 34 | domain_search: [] 35 | enable: false 36 | failover_peers: 37 | dhcp-failover: 38 | address: 10.152.187.5 39 | mclt: 3600 40 | peer_address: 10.152.187.6 41 | peer_port: 647 42 | port: 647 43 | primary: true 44 | split: 128 45 | get_lease_hostnames: '' 46 | hosts: 47 | fantasia: 48 | comment: 'Fixed IP addresses can also be specified for hosts. These addresses 49 | 50 | should not also be listed as being available for dynamic assignment. 51 | 52 | Hosts for which fixed IP addresses have been specified can boot using 53 | 54 | BOOTP or DHCP. Hosts for which no fixed address is specified can only 55 | 56 | be booted with DHCP, unless there is an address range on the subnet 57 | 58 | to which a BOOTP client is connected which has the dynamic-bootp flag 59 | 60 | set.' 61 | fixed_address: fantasia.fugue.com 62 | hardware: ethernet 08:00:07:26:c0:a5 63 | joe: 64 | comment: 'The hostname for a host can be passed in the DHCP response. Using 65 | the 66 | 67 | host_name key sets option host-name in the dhcpd configuration.' 68 | fixed_address: joe.fugue.com 69 | hardware: ethernet 08:00:2b:4c:29:32 70 | host_name: joe 71 | passacaglia: 72 | comment: 'Hosts which require special configuration options can be listed 73 | in 74 | 75 | host statements. If no address is specified, the address will be 76 | 77 | allocated dynamically (if possible), but the host-specific information 78 | 79 | will still come from the host declaration.' 80 | filename: vmunix.passacaglia 81 | hardware: ethernet 0:0:c0:5d:bd:95 82 | server_name: toccata.fugue.com 83 | keys: {} 84 | ldap_base_dn: '' 85 | ldap_debug_file: '' 86 | ldap_init_retry: 0 87 | ldap_method: '' 88 | ldap_password: '' 89 | ldap_port: '' 90 | ldap_server: '' 91 | ldap_ssl: '' 92 | ldap_tls_ca_dir: '' 93 | ldap_tls_ca_file: '' 94 | ldap_tls_cert: '' 95 | ldap_tls_ciphers: '' 96 | ldap_tls_crlcheck: '' 97 | ldap_tls_key: '' 98 | ldap_tls_randfile: '' 99 | ldap_tls_reqcert: '' 100 | ldap_username: '' 101 | listen_interfaces: 102 | - em1 103 | - em2 104 | log_facility: local7 105 | lookup: 106 | enable: false 107 | max_lease_time: 7200 108 | one_lease_per_client: '' 109 | routers: [] 110 | server: dhcp-server 111 | server_identifier: '' 112 | server_name: '' 113 | service: dhcpd 114 | service_config: /etc/systemd/system/dhcpd.service.d/override.conf 115 | shared_networks: 116 | 224-29: 117 | pools: 118 | - allow: members of "foo" 119 | range: 120 | - 10.17.224.10 121 | - 10.17.224.250 122 | - deny: members of "foo" 123 | range: 124 | - 10.0.29.10 125 | - 10.0.29.230 126 | subnets: 127 | 10.0.29.0: 128 | netmask: 255.255.255.0 129 | routers: rtr-29.example.org 130 | 10.17.224.0: 131 | netmask: 255.255.255.0 132 | routers: rtr-224.example.org 133 | subnet_mask: '' 134 | subnets: 135 | 10.152.187.0: 136 | comment: 'No service will be given on this subnet, but declaring it helps 137 | the 138 | 139 | DHCP server to understand the network topology.' 140 | netmask: 255.255.255.0 141 | pools: 142 | - failover_peer: dhcp-failover 143 | range: 144 | - 10.152.187.1 145 | - 10.152.187.254 146 | 10.254.239.0: 147 | comment: This is a very basic subnet declaration. 148 | netmask: 255.255.255.224 149 | range: 150 | - 10.254.239.10 151 | - 10.254.239.20 152 | routers: 153 | - rtr-239-0-1.example.org 154 | - rtr-239-0-2.example.org 155 | 10.254.239.32: 156 | broadcast_address: 10.254.239.31 157 | comment: 'This declaration allows BOOTP clients to get dynamic addresses, 158 | 159 | which we don''t really recommend.' 160 | dynamic_bootp: true 161 | netmask: 255.255.255.224 162 | range: 163 | - 10.254.239.40 164 | - 10.254.239.60 165 | routers: rtr-239-32-1.example.org 166 | 10.5.5.0: 167 | broadcast_address: 10.5.5.31 168 | comment: A slightly different configuration for an internal subnet. 169 | default_lease_time: 600 170 | domain_name: internal.example.org 171 | domain_name_servers: 172 | - ns1.internal.example.org 173 | hosts: 174 | jake: 175 | comment: Hosts can be specified for subnets, taking subnets defaults 176 | fixed_address: 10.5.5.27 177 | hardware: ethernet 08:00:a7:26:c0:a9 178 | max_lease_time: 7200 179 | netmask: 255.255.255.224 180 | range: 181 | - 10.5.5.26 182 | - 10.5.5.30 183 | routers: 184 | - 10.5.5.1 185 | update_static_leases: false 186 | use_host_decl_names: false 187 | zones: {} 188 | -------------------------------------------------------------------------------- /test/integration/default/files/_mapdata/fedora-35.yaml: -------------------------------------------------------------------------------- 1 | # yamllint disable rule:indentation rule:line-length 2 | # Fedora-35 3 | --- 4 | values: 5 | allow: 6 | - booting 7 | - bootp 8 | arch: amd64 9 | authoritative: false 10 | classes: 11 | foo: 12 | comment: 'You can declare a class of clients and then do address allocation 13 | 14 | based on that. The example below shows a case where all clients 15 | 16 | in a certain class get addresses on the 10.17.224/24 subnet, and all 17 | 18 | other clients get addresses on the 10.0.29/24 subnet.' 19 | match: if substring (option vendor-class-identifier, 0, 4) = "SUNW" 20 | config: /etc/dhcp/dhcpd.conf 21 | customized_options: 22 | auto_proxy_config: 23 | code: 252 24 | type: string 25 | ddns_domainname: '' 26 | ddns_rev_domainname: '' 27 | ddns_update_style: '' 28 | default_lease_time: 600 29 | deny: unknown-clients 30 | domain_name: example.org 31 | domain_name_servers: 32 | - ns1.example.org 33 | - ns2.example.org 34 | domain_search: [] 35 | enable: false 36 | failover_peers: 37 | dhcp-failover: 38 | address: 10.152.187.5 39 | mclt: 3600 40 | peer_address: 10.152.187.6 41 | peer_port: 647 42 | port: 647 43 | primary: true 44 | split: 128 45 | get_lease_hostnames: '' 46 | hosts: 47 | fantasia: 48 | comment: 'Fixed IP addresses can also be specified for hosts. These addresses 49 | 50 | should not also be listed as being available for dynamic assignment. 51 | 52 | Hosts for which fixed IP addresses have been specified can boot using 53 | 54 | BOOTP or DHCP. Hosts for which no fixed address is specified can only 55 | 56 | be booted with DHCP, unless there is an address range on the subnet 57 | 58 | to which a BOOTP client is connected which has the dynamic-bootp flag 59 | 60 | set.' 61 | fixed_address: fantasia.fugue.com 62 | hardware: ethernet 08:00:07:26:c0:a5 63 | joe: 64 | comment: 'The hostname for a host can be passed in the DHCP response. Using 65 | the 66 | 67 | host_name key sets option host-name in the dhcpd configuration.' 68 | fixed_address: joe.fugue.com 69 | hardware: ethernet 08:00:2b:4c:29:32 70 | host_name: joe 71 | passacaglia: 72 | comment: 'Hosts which require special configuration options can be listed 73 | in 74 | 75 | host statements. If no address is specified, the address will be 76 | 77 | allocated dynamically (if possible), but the host-specific information 78 | 79 | will still come from the host declaration.' 80 | filename: vmunix.passacaglia 81 | hardware: ethernet 0:0:c0:5d:bd:95 82 | server_name: toccata.fugue.com 83 | keys: {} 84 | ldap_base_dn: '' 85 | ldap_debug_file: '' 86 | ldap_init_retry: 0 87 | ldap_method: '' 88 | ldap_password: '' 89 | ldap_port: '' 90 | ldap_server: '' 91 | ldap_ssl: '' 92 | ldap_tls_ca_dir: '' 93 | ldap_tls_ca_file: '' 94 | ldap_tls_cert: '' 95 | ldap_tls_ciphers: '' 96 | ldap_tls_crlcheck: '' 97 | ldap_tls_key: '' 98 | ldap_tls_randfile: '' 99 | ldap_tls_reqcert: '' 100 | ldap_username: '' 101 | listen_interfaces: 102 | - em1 103 | - em2 104 | log_facility: local7 105 | lookup: 106 | enable: false 107 | max_lease_time: 7200 108 | one_lease_per_client: '' 109 | routers: [] 110 | server: dhcp-server 111 | server_identifier: '' 112 | server_name: '' 113 | service: dhcpd 114 | service_config: /etc/systemd/system/dhcpd.service.d/override.conf 115 | shared_networks: 116 | 224-29: 117 | pools: 118 | - allow: members of "foo" 119 | range: 120 | - 10.17.224.10 121 | - 10.17.224.250 122 | - deny: members of "foo" 123 | range: 124 | - 10.0.29.10 125 | - 10.0.29.230 126 | subnets: 127 | 10.0.29.0: 128 | netmask: 255.255.255.0 129 | routers: rtr-29.example.org 130 | 10.17.224.0: 131 | netmask: 255.255.255.0 132 | routers: rtr-224.example.org 133 | subnet_mask: '' 134 | subnets: 135 | 10.152.187.0: 136 | comment: 'No service will be given on this subnet, but declaring it helps 137 | the 138 | 139 | DHCP server to understand the network topology.' 140 | netmask: 255.255.255.0 141 | pools: 142 | - failover_peer: dhcp-failover 143 | range: 144 | - 10.152.187.1 145 | - 10.152.187.254 146 | 10.254.239.0: 147 | comment: This is a very basic subnet declaration. 148 | netmask: 255.255.255.224 149 | range: 150 | - 10.254.239.10 151 | - 10.254.239.20 152 | routers: 153 | - rtr-239-0-1.example.org 154 | - rtr-239-0-2.example.org 155 | 10.254.239.32: 156 | broadcast_address: 10.254.239.31 157 | comment: 'This declaration allows BOOTP clients to get dynamic addresses, 158 | 159 | which we don''t really recommend.' 160 | dynamic_bootp: true 161 | netmask: 255.255.255.224 162 | range: 163 | - 10.254.239.40 164 | - 10.254.239.60 165 | routers: rtr-239-32-1.example.org 166 | 10.5.5.0: 167 | broadcast_address: 10.5.5.31 168 | comment: A slightly different configuration for an internal subnet. 169 | default_lease_time: 600 170 | domain_name: internal.example.org 171 | domain_name_servers: 172 | - ns1.internal.example.org 173 | hosts: 174 | jake: 175 | comment: Hosts can be specified for subnets, taking subnets defaults 176 | fixed_address: 10.5.5.27 177 | hardware: ethernet 08:00:a7:26:c0:a9 178 | max_lease_time: 7200 179 | netmask: 255.255.255.224 180 | range: 181 | - 10.5.5.26 182 | - 10.5.5.30 183 | routers: 184 | - 10.5.5.1 185 | update_static_leases: false 186 | use_host_decl_names: false 187 | zones: {} 188 | -------------------------------------------------------------------------------- /test/integration/default/files/_mapdata/fedora-36.yaml: -------------------------------------------------------------------------------- 1 | # yamllint disable rule:indentation rule:line-length 2 | # Fedora-36 3 | --- 4 | values: 5 | allow: 6 | - booting 7 | - bootp 8 | arch: amd64 9 | authoritative: false 10 | classes: 11 | foo: 12 | comment: 'You can declare a class of clients and then do address allocation 13 | 14 | based on that. The example below shows a case where all clients 15 | 16 | in a certain class get addresses on the 10.17.224/24 subnet, and all 17 | 18 | other clients get addresses on the 10.0.29/24 subnet.' 19 | match: if substring (option vendor-class-identifier, 0, 4) = "SUNW" 20 | config: /etc/dhcp/dhcpd.conf 21 | customized_options: 22 | auto_proxy_config: 23 | code: 252 24 | type: string 25 | ddns_domainname: '' 26 | ddns_rev_domainname: '' 27 | ddns_update_style: '' 28 | default_lease_time: 600 29 | deny: unknown-clients 30 | domain_name: example.org 31 | domain_name_servers: 32 | - ns1.example.org 33 | - ns2.example.org 34 | domain_search: [] 35 | enable: false 36 | failover_peers: 37 | dhcp-failover: 38 | address: 10.152.187.5 39 | mclt: 3600 40 | peer_address: 10.152.187.6 41 | peer_port: 647 42 | port: 647 43 | primary: true 44 | split: 128 45 | get_lease_hostnames: '' 46 | hosts: 47 | fantasia: 48 | comment: 'Fixed IP addresses can also be specified for hosts. These addresses 49 | 50 | should not also be listed as being available for dynamic assignment. 51 | 52 | Hosts for which fixed IP addresses have been specified can boot using 53 | 54 | BOOTP or DHCP. Hosts for which no fixed address is specified can only 55 | 56 | be booted with DHCP, unless there is an address range on the subnet 57 | 58 | to which a BOOTP client is connected which has the dynamic-bootp flag 59 | 60 | set.' 61 | fixed_address: fantasia.fugue.com 62 | hardware: ethernet 08:00:07:26:c0:a5 63 | joe: 64 | comment: 'The hostname for a host can be passed in the DHCP response. Using 65 | the 66 | 67 | host_name key sets option host-name in the dhcpd configuration.' 68 | fixed_address: joe.fugue.com 69 | hardware: ethernet 08:00:2b:4c:29:32 70 | host_name: joe 71 | passacaglia: 72 | comment: 'Hosts which require special configuration options can be listed 73 | in 74 | 75 | host statements. If no address is specified, the address will be 76 | 77 | allocated dynamically (if possible), but the host-specific information 78 | 79 | will still come from the host declaration.' 80 | filename: vmunix.passacaglia 81 | hardware: ethernet 0:0:c0:5d:bd:95 82 | server_name: toccata.fugue.com 83 | keys: {} 84 | ldap_base_dn: '' 85 | ldap_debug_file: '' 86 | ldap_init_retry: 0 87 | ldap_method: '' 88 | ldap_password: '' 89 | ldap_port: '' 90 | ldap_server: '' 91 | ldap_ssl: '' 92 | ldap_tls_ca_dir: '' 93 | ldap_tls_ca_file: '' 94 | ldap_tls_cert: '' 95 | ldap_tls_ciphers: '' 96 | ldap_tls_crlcheck: '' 97 | ldap_tls_key: '' 98 | ldap_tls_randfile: '' 99 | ldap_tls_reqcert: '' 100 | ldap_username: '' 101 | listen_interfaces: 102 | - em1 103 | - em2 104 | log_facility: local7 105 | lookup: 106 | enable: false 107 | max_lease_time: 7200 108 | one_lease_per_client: '' 109 | routers: [] 110 | server: dhcp-server 111 | server_identifier: '' 112 | server_name: '' 113 | service: dhcpd 114 | service_config: /etc/systemd/system/dhcpd.service.d/override.conf 115 | shared_networks: 116 | 224-29: 117 | pools: 118 | - allow: members of "foo" 119 | range: 120 | - 10.17.224.10 121 | - 10.17.224.250 122 | - deny: members of "foo" 123 | range: 124 | - 10.0.29.10 125 | - 10.0.29.230 126 | subnets: 127 | 10.0.29.0: 128 | netmask: 255.255.255.0 129 | routers: rtr-29.example.org 130 | 10.17.224.0: 131 | netmask: 255.255.255.0 132 | routers: rtr-224.example.org 133 | subnet_mask: '' 134 | subnets: 135 | 10.152.187.0: 136 | comment: 'No service will be given on this subnet, but declaring it helps 137 | the 138 | 139 | DHCP server to understand the network topology.' 140 | netmask: 255.255.255.0 141 | pools: 142 | - failover_peer: dhcp-failover 143 | range: 144 | - 10.152.187.1 145 | - 10.152.187.254 146 | 10.254.239.0: 147 | comment: This is a very basic subnet declaration. 148 | netmask: 255.255.255.224 149 | range: 150 | - 10.254.239.10 151 | - 10.254.239.20 152 | routers: 153 | - rtr-239-0-1.example.org 154 | - rtr-239-0-2.example.org 155 | 10.254.239.32: 156 | broadcast_address: 10.254.239.31 157 | comment: 'This declaration allows BOOTP clients to get dynamic addresses, 158 | 159 | which we don''t really recommend.' 160 | dynamic_bootp: true 161 | netmask: 255.255.255.224 162 | range: 163 | - 10.254.239.40 164 | - 10.254.239.60 165 | routers: rtr-239-32-1.example.org 166 | 10.5.5.0: 167 | broadcast_address: 10.5.5.31 168 | comment: A slightly different configuration for an internal subnet. 169 | default_lease_time: 600 170 | domain_name: internal.example.org 171 | domain_name_servers: 172 | - ns1.internal.example.org 173 | hosts: 174 | jake: 175 | comment: Hosts can be specified for subnets, taking subnets defaults 176 | fixed_address: 10.5.5.27 177 | hardware: ethernet 08:00:a7:26:c0:a9 178 | max_lease_time: 7200 179 | netmask: 255.255.255.224 180 | range: 181 | - 10.5.5.26 182 | - 10.5.5.30 183 | routers: 184 | - 10.5.5.1 185 | update_static_leases: false 186 | use_host_decl_names: false 187 | zones: {} 188 | -------------------------------------------------------------------------------- /test/integration/default/files/_mapdata/gentoo-2-sysd.yaml: -------------------------------------------------------------------------------- 1 | # yamllint disable rule:indentation rule:line-length 2 | # Gentoo-2 3 | --- 4 | values: 5 | allow: 6 | - booting 7 | - bootp 8 | arch: amd64 9 | authoritative: false 10 | classes: 11 | foo: 12 | comment: 'You can declare a class of clients and then do address allocation 13 | 14 | based on that. The example below shows a case where all clients 15 | 16 | in a certain class get addresses on the 10.17.224/24 subnet, and all 17 | 18 | other clients get addresses on the 10.0.29/24 subnet.' 19 | match: if substring (option vendor-class-identifier, 0, 4) = "SUNW" 20 | config: /etc/dhcp/dhcpd.conf 21 | customized_options: 22 | auto_proxy_config: 23 | code: 252 24 | type: string 25 | ddns_domainname: '' 26 | ddns_rev_domainname: '' 27 | ddns_update_style: '' 28 | default_lease_time: 600 29 | deny: unknown-clients 30 | domain_name: example.org 31 | domain_name_servers: 32 | - ns1.example.org 33 | - ns2.example.org 34 | domain_search: [] 35 | enable: false 36 | failover_peers: 37 | dhcp-failover: 38 | address: 10.152.187.5 39 | mclt: 3600 40 | peer_address: 10.152.187.6 41 | peer_port: 647 42 | port: 647 43 | primary: true 44 | split: 128 45 | get_lease_hostnames: '' 46 | hosts: 47 | fantasia: 48 | comment: 'Fixed IP addresses can also be specified for hosts. These addresses 49 | 50 | should not also be listed as being available for dynamic assignment. 51 | 52 | Hosts for which fixed IP addresses have been specified can boot using 53 | 54 | BOOTP or DHCP. Hosts for which no fixed address is specified can only 55 | 56 | be booted with DHCP, unless there is an address range on the subnet 57 | 58 | to which a BOOTP client is connected which has the dynamic-bootp flag 59 | 60 | set.' 61 | fixed_address: fantasia.fugue.com 62 | hardware: ethernet 08:00:07:26:c0:a5 63 | joe: 64 | comment: 'The hostname for a host can be passed in the DHCP response. Using 65 | the 66 | 67 | host_name key sets option host-name in the dhcpd configuration.' 68 | fixed_address: joe.fugue.com 69 | hardware: ethernet 08:00:2b:4c:29:32 70 | host_name: joe 71 | passacaglia: 72 | comment: 'Hosts which require special configuration options can be listed 73 | in 74 | 75 | host statements. If no address is specified, the address will be 76 | 77 | allocated dynamically (if possible), but the host-specific information 78 | 79 | will still come from the host declaration.' 80 | filename: vmunix.passacaglia 81 | hardware: ethernet 0:0:c0:5d:bd:95 82 | server_name: toccata.fugue.com 83 | keys: {} 84 | ldap_base_dn: '' 85 | ldap_debug_file: '' 86 | ldap_init_retry: 0 87 | ldap_method: '' 88 | ldap_password: '' 89 | ldap_port: '' 90 | ldap_server: '' 91 | ldap_ssl: '' 92 | ldap_tls_ca_dir: '' 93 | ldap_tls_ca_file: '' 94 | ldap_tls_cert: '' 95 | ldap_tls_ciphers: '' 96 | ldap_tls_crlcheck: '' 97 | ldap_tls_key: '' 98 | ldap_tls_randfile: '' 99 | ldap_tls_reqcert: '' 100 | ldap_username: '' 101 | listen_interfaces: 102 | - em1 103 | - em2 104 | log_facility: local7 105 | lookup: 106 | enable: false 107 | max_lease_time: 7200 108 | one_lease_per_client: '' 109 | routers: [] 110 | server: net-misc/dhcp 111 | server_identifier: '' 112 | server_name: '' 113 | service: dhcpd 114 | service_config: /etc/conf.d/dhcpd 115 | shared_networks: 116 | 224-29: 117 | pools: 118 | - allow: members of "foo" 119 | range: 120 | - 10.17.224.10 121 | - 10.17.224.250 122 | - deny: members of "foo" 123 | range: 124 | - 10.0.29.10 125 | - 10.0.29.230 126 | subnets: 127 | 10.0.29.0: 128 | netmask: 255.255.255.0 129 | routers: rtr-29.example.org 130 | 10.17.224.0: 131 | netmask: 255.255.255.0 132 | routers: rtr-224.example.org 133 | subnet_mask: '' 134 | subnets: 135 | 10.152.187.0: 136 | comment: 'No service will be given on this subnet, but declaring it helps 137 | the 138 | 139 | DHCP server to understand the network topology.' 140 | netmask: 255.255.255.0 141 | pools: 142 | - failover_peer: dhcp-failover 143 | range: 144 | - 10.152.187.1 145 | - 10.152.187.254 146 | 10.254.239.0: 147 | comment: This is a very basic subnet declaration. 148 | netmask: 255.255.255.224 149 | range: 150 | - 10.254.239.10 151 | - 10.254.239.20 152 | routers: 153 | - rtr-239-0-1.example.org 154 | - rtr-239-0-2.example.org 155 | 10.254.239.32: 156 | broadcast_address: 10.254.239.31 157 | comment: 'This declaration allows BOOTP clients to get dynamic addresses, 158 | 159 | which we don''t really recommend.' 160 | dynamic_bootp: true 161 | netmask: 255.255.255.224 162 | range: 163 | - 10.254.239.40 164 | - 10.254.239.60 165 | routers: rtr-239-32-1.example.org 166 | 10.5.5.0: 167 | broadcast_address: 10.5.5.31 168 | comment: A slightly different configuration for an internal subnet. 169 | default_lease_time: 600 170 | domain_name: internal.example.org 171 | domain_name_servers: 172 | - ns1.internal.example.org 173 | hosts: 174 | jake: 175 | comment: Hosts can be specified for subnets, taking subnets defaults 176 | fixed_address: 10.5.5.27 177 | hardware: ethernet 08:00:a7:26:c0:a9 178 | max_lease_time: 7200 179 | netmask: 255.255.255.224 180 | range: 181 | - 10.5.5.26 182 | - 10.5.5.30 183 | routers: 184 | - 10.5.5.1 185 | update_static_leases: false 186 | use_host_decl_names: false 187 | zones: {} 188 | -------------------------------------------------------------------------------- /test/integration/default/files/_mapdata/gentoo-2-sysv.yaml: -------------------------------------------------------------------------------- 1 | # yamllint disable rule:indentation rule:line-length 2 | # Gentoo-2 3 | --- 4 | values: 5 | allow: 6 | - booting 7 | - bootp 8 | arch: amd64 9 | authoritative: false 10 | classes: 11 | foo: 12 | comment: 'You can declare a class of clients and then do address allocation 13 | 14 | based on that. The example below shows a case where all clients 15 | 16 | in a certain class get addresses on the 10.17.224/24 subnet, and all 17 | 18 | other clients get addresses on the 10.0.29/24 subnet.' 19 | match: if substring (option vendor-class-identifier, 0, 4) = "SUNW" 20 | config: /etc/dhcp/dhcpd.conf 21 | customized_options: 22 | auto_proxy_config: 23 | code: 252 24 | type: string 25 | ddns_domainname: '' 26 | ddns_rev_domainname: '' 27 | ddns_update_style: '' 28 | default_lease_time: 600 29 | deny: unknown-clients 30 | domain_name: example.org 31 | domain_name_servers: 32 | - ns1.example.org 33 | - ns2.example.org 34 | domain_search: [] 35 | enable: false 36 | failover_peers: 37 | dhcp-failover: 38 | address: 10.152.187.5 39 | mclt: 3600 40 | peer_address: 10.152.187.6 41 | peer_port: 647 42 | port: 647 43 | primary: true 44 | split: 128 45 | get_lease_hostnames: '' 46 | hosts: 47 | fantasia: 48 | comment: 'Fixed IP addresses can also be specified for hosts. These addresses 49 | 50 | should not also be listed as being available for dynamic assignment. 51 | 52 | Hosts for which fixed IP addresses have been specified can boot using 53 | 54 | BOOTP or DHCP. Hosts for which no fixed address is specified can only 55 | 56 | be booted with DHCP, unless there is an address range on the subnet 57 | 58 | to which a BOOTP client is connected which has the dynamic-bootp flag 59 | 60 | set.' 61 | fixed_address: fantasia.fugue.com 62 | hardware: ethernet 08:00:07:26:c0:a5 63 | joe: 64 | comment: 'The hostname for a host can be passed in the DHCP response. Using 65 | the 66 | 67 | host_name key sets option host-name in the dhcpd configuration.' 68 | fixed_address: joe.fugue.com 69 | hardware: ethernet 08:00:2b:4c:29:32 70 | host_name: joe 71 | passacaglia: 72 | comment: 'Hosts which require special configuration options can be listed 73 | in 74 | 75 | host statements. If no address is specified, the address will be 76 | 77 | allocated dynamically (if possible), but the host-specific information 78 | 79 | will still come from the host declaration.' 80 | filename: vmunix.passacaglia 81 | hardware: ethernet 0:0:c0:5d:bd:95 82 | server_name: toccata.fugue.com 83 | keys: {} 84 | ldap_base_dn: '' 85 | ldap_debug_file: '' 86 | ldap_init_retry: 0 87 | ldap_method: '' 88 | ldap_password: '' 89 | ldap_port: '' 90 | ldap_server: '' 91 | ldap_ssl: '' 92 | ldap_tls_ca_dir: '' 93 | ldap_tls_ca_file: '' 94 | ldap_tls_cert: '' 95 | ldap_tls_ciphers: '' 96 | ldap_tls_crlcheck: '' 97 | ldap_tls_key: '' 98 | ldap_tls_randfile: '' 99 | ldap_tls_reqcert: '' 100 | ldap_username: '' 101 | listen_interfaces: 102 | - em1 103 | - em2 104 | log_facility: local7 105 | lookup: 106 | enable: false 107 | max_lease_time: 7200 108 | one_lease_per_client: '' 109 | routers: [] 110 | server: net-misc/dhcp 111 | server_identifier: '' 112 | server_name: '' 113 | service: dhcpd 114 | service_config: /etc/conf.d/dhcpd 115 | shared_networks: 116 | 224-29: 117 | pools: 118 | - allow: members of "foo" 119 | range: 120 | - 10.17.224.10 121 | - 10.17.224.250 122 | - deny: members of "foo" 123 | range: 124 | - 10.0.29.10 125 | - 10.0.29.230 126 | subnets: 127 | 10.0.29.0: 128 | netmask: 255.255.255.0 129 | routers: rtr-29.example.org 130 | 10.17.224.0: 131 | netmask: 255.255.255.0 132 | routers: rtr-224.example.org 133 | subnet_mask: '' 134 | subnets: 135 | 10.152.187.0: 136 | comment: 'No service will be given on this subnet, but declaring it helps 137 | the 138 | 139 | DHCP server to understand the network topology.' 140 | netmask: 255.255.255.0 141 | pools: 142 | - failover_peer: dhcp-failover 143 | range: 144 | - 10.152.187.1 145 | - 10.152.187.254 146 | 10.254.239.0: 147 | comment: This is a very basic subnet declaration. 148 | netmask: 255.255.255.224 149 | range: 150 | - 10.254.239.10 151 | - 10.254.239.20 152 | routers: 153 | - rtr-239-0-1.example.org 154 | - rtr-239-0-2.example.org 155 | 10.254.239.32: 156 | broadcast_address: 10.254.239.31 157 | comment: 'This declaration allows BOOTP clients to get dynamic addresses, 158 | 159 | which we don''t really recommend.' 160 | dynamic_bootp: true 161 | netmask: 255.255.255.224 162 | range: 163 | - 10.254.239.40 164 | - 10.254.239.60 165 | routers: rtr-239-32-1.example.org 166 | 10.5.5.0: 167 | broadcast_address: 10.5.5.31 168 | comment: A slightly different configuration for an internal subnet. 169 | default_lease_time: 600 170 | domain_name: internal.example.org 171 | domain_name_servers: 172 | - ns1.internal.example.org 173 | hosts: 174 | jake: 175 | comment: Hosts can be specified for subnets, taking subnets defaults 176 | fixed_address: 10.5.5.27 177 | hardware: ethernet 08:00:a7:26:c0:a9 178 | max_lease_time: 7200 179 | netmask: 255.255.255.224 180 | range: 181 | - 10.5.5.26 182 | - 10.5.5.30 183 | routers: 184 | - 10.5.5.1 185 | update_static_leases: false 186 | use_host_decl_names: false 187 | zones: {} 188 | -------------------------------------------------------------------------------- /test/integration/default/files/_mapdata/opensuse-15.yaml: -------------------------------------------------------------------------------- 1 | # yamllint disable rule:indentation rule:line-length 2 | # Leap-15 3 | --- 4 | values: 5 | allow: 6 | - booting 7 | - bootp 8 | arch: amd64 9 | authoritative: false 10 | classes: 11 | foo: 12 | comment: 'You can declare a class of clients and then do address allocation 13 | 14 | based on that. The example below shows a case where all clients 15 | 16 | in a certain class get addresses on the 10.17.224/24 subnet, and all 17 | 18 | other clients get addresses on the 10.0.29/24 subnet.' 19 | match: if substring (option vendor-class-identifier, 0, 4) = "SUNW" 20 | config: /etc/dhcpd.conf 21 | customized_options: 22 | auto_proxy_config: 23 | code: 252 24 | type: string 25 | ddns_domainname: '' 26 | ddns_rev_domainname: '' 27 | ddns_update_style: '' 28 | default_lease_time: 600 29 | deny: unknown-clients 30 | domain_name: example.org 31 | domain_name_servers: 32 | - ns1.example.org 33 | - ns2.example.org 34 | domain_search: [] 35 | enable: false 36 | failover_peers: 37 | dhcp-failover: 38 | address: 10.152.187.5 39 | mclt: 3600 40 | peer_address: 10.152.187.6 41 | peer_port: 647 42 | port: 647 43 | primary: true 44 | split: 128 45 | get_lease_hostnames: '' 46 | hosts: 47 | fantasia: 48 | comment: 'Fixed IP addresses can also be specified for hosts. These addresses 49 | 50 | should not also be listed as being available for dynamic assignment. 51 | 52 | Hosts for which fixed IP addresses have been specified can boot using 53 | 54 | BOOTP or DHCP. Hosts for which no fixed address is specified can only 55 | 56 | be booted with DHCP, unless there is an address range on the subnet 57 | 58 | to which a BOOTP client is connected which has the dynamic-bootp flag 59 | 60 | set.' 61 | fixed_address: fantasia.fugue.com 62 | hardware: ethernet 08:00:07:26:c0:a5 63 | joe: 64 | comment: 'The hostname for a host can be passed in the DHCP response. Using 65 | the 66 | 67 | host_name key sets option host-name in the dhcpd configuration.' 68 | fixed_address: joe.fugue.com 69 | hardware: ethernet 08:00:2b:4c:29:32 70 | host_name: joe 71 | passacaglia: 72 | comment: 'Hosts which require special configuration options can be listed 73 | in 74 | 75 | host statements. If no address is specified, the address will be 76 | 77 | allocated dynamically (if possible), but the host-specific information 78 | 79 | will still come from the host declaration.' 80 | filename: vmunix.passacaglia 81 | hardware: ethernet 0:0:c0:5d:bd:95 82 | server_name: toccata.fugue.com 83 | keys: {} 84 | ldap_base_dn: '' 85 | ldap_debug_file: '' 86 | ldap_init_retry: 0 87 | ldap_method: '' 88 | ldap_password: '' 89 | ldap_port: '' 90 | ldap_server: '' 91 | ldap_ssl: '' 92 | ldap_tls_ca_dir: '' 93 | ldap_tls_ca_file: '' 94 | ldap_tls_cert: '' 95 | ldap_tls_ciphers: '' 96 | ldap_tls_crlcheck: '' 97 | ldap_tls_key: '' 98 | ldap_tls_randfile: '' 99 | ldap_tls_reqcert: '' 100 | ldap_username: '' 101 | listen_interfaces: 102 | - em1 103 | - em2 104 | log_facility: local7 105 | lookup: 106 | enable: false 107 | max_lease_time: 7200 108 | one_lease_per_client: '' 109 | routers: [] 110 | server: dhcp-server 111 | server_identifier: '' 112 | server_name: '' 113 | service: dhcpd 114 | shared_networks: 115 | 224-29: 116 | pools: 117 | - allow: members of "foo" 118 | range: 119 | - 10.17.224.10 120 | - 10.17.224.250 121 | - deny: members of "foo" 122 | range: 123 | - 10.0.29.10 124 | - 10.0.29.230 125 | subnets: 126 | 10.0.29.0: 127 | netmask: 255.255.255.0 128 | routers: rtr-29.example.org 129 | 10.17.224.0: 130 | netmask: 255.255.255.0 131 | routers: rtr-224.example.org 132 | subnet_mask: '' 133 | subnets: 134 | 10.152.187.0: 135 | comment: 'No service will be given on this subnet, but declaring it helps 136 | the 137 | 138 | DHCP server to understand the network topology.' 139 | netmask: 255.255.255.0 140 | pools: 141 | - failover_peer: dhcp-failover 142 | range: 143 | - 10.152.187.1 144 | - 10.152.187.254 145 | 10.254.239.0: 146 | comment: This is a very basic subnet declaration. 147 | netmask: 255.255.255.224 148 | range: 149 | - 10.254.239.10 150 | - 10.254.239.20 151 | routers: 152 | - rtr-239-0-1.example.org 153 | - rtr-239-0-2.example.org 154 | 10.254.239.32: 155 | broadcast_address: 10.254.239.31 156 | comment: 'This declaration allows BOOTP clients to get dynamic addresses, 157 | 158 | which we don''t really recommend.' 159 | dynamic_bootp: true 160 | netmask: 255.255.255.224 161 | range: 162 | - 10.254.239.40 163 | - 10.254.239.60 164 | routers: rtr-239-32-1.example.org 165 | 10.5.5.0: 166 | broadcast_address: 10.5.5.31 167 | comment: A slightly different configuration for an internal subnet. 168 | default_lease_time: 600 169 | domain_name: internal.example.org 170 | domain_name_servers: 171 | - ns1.internal.example.org 172 | hosts: 173 | jake: 174 | comment: Hosts can be specified for subnets, taking subnets defaults 175 | fixed_address: 10.5.5.27 176 | hardware: ethernet 08:00:a7:26:c0:a9 177 | max_lease_time: 7200 178 | netmask: 255.255.255.224 179 | range: 180 | - 10.5.5.26 181 | - 10.5.5.30 182 | routers: 183 | - 10.5.5.1 184 | update_static_leases: false 185 | use_host_decl_names: false 186 | zones: {} 187 | -------------------------------------------------------------------------------- /test/integration/default/files/_mapdata/oraclelinux-7.yaml: -------------------------------------------------------------------------------- 1 | # yamllint disable rule:indentation rule:line-length 2 | # Oracle Linux Server-7 3 | --- 4 | values: 5 | allow: 6 | - booting 7 | - bootp 8 | arch: amd64 9 | authoritative: false 10 | classes: 11 | foo: 12 | comment: 'You can declare a class of clients and then do address allocation 13 | 14 | based on that. The example below shows a case where all clients 15 | 16 | in a certain class get addresses on the 10.17.224/24 subnet, and all 17 | 18 | other clients get addresses on the 10.0.29/24 subnet.' 19 | match: if substring (option vendor-class-identifier, 0, 4) = "SUNW" 20 | config: /etc/dhcp/dhcpd.conf 21 | customized_options: 22 | auto_proxy_config: 23 | code: 252 24 | type: string 25 | ddns_domainname: '' 26 | ddns_rev_domainname: '' 27 | ddns_update_style: '' 28 | default_lease_time: 600 29 | deny: unknown-clients 30 | domain_name: example.org 31 | domain_name_servers: 32 | - ns1.example.org 33 | - ns2.example.org 34 | domain_search: [] 35 | enable: false 36 | failover_peers: 37 | dhcp-failover: 38 | address: 10.152.187.5 39 | mclt: 3600 40 | peer_address: 10.152.187.6 41 | peer_port: 647 42 | port: 647 43 | primary: true 44 | split: 128 45 | get_lease_hostnames: '' 46 | hosts: 47 | fantasia: 48 | comment: 'Fixed IP addresses can also be specified for hosts. These addresses 49 | 50 | should not also be listed as being available for dynamic assignment. 51 | 52 | Hosts for which fixed IP addresses have been specified can boot using 53 | 54 | BOOTP or DHCP. Hosts for which no fixed address is specified can only 55 | 56 | be booted with DHCP, unless there is an address range on the subnet 57 | 58 | to which a BOOTP client is connected which has the dynamic-bootp flag 59 | 60 | set.' 61 | fixed_address: fantasia.fugue.com 62 | hardware: ethernet 08:00:07:26:c0:a5 63 | joe: 64 | comment: 'The hostname for a host can be passed in the DHCP response. Using 65 | the 66 | 67 | host_name key sets option host-name in the dhcpd configuration.' 68 | fixed_address: joe.fugue.com 69 | hardware: ethernet 08:00:2b:4c:29:32 70 | host_name: joe 71 | passacaglia: 72 | comment: 'Hosts which require special configuration options can be listed 73 | in 74 | 75 | host statements. If no address is specified, the address will be 76 | 77 | allocated dynamically (if possible), but the host-specific information 78 | 79 | will still come from the host declaration.' 80 | filename: vmunix.passacaglia 81 | hardware: ethernet 0:0:c0:5d:bd:95 82 | server_name: toccata.fugue.com 83 | keys: {} 84 | ldap_base_dn: '' 85 | ldap_debug_file: '' 86 | ldap_init_retry: 0 87 | ldap_method: '' 88 | ldap_password: '' 89 | ldap_port: '' 90 | ldap_server: '' 91 | ldap_ssl: '' 92 | ldap_tls_ca_dir: '' 93 | ldap_tls_ca_file: '' 94 | ldap_tls_cert: '' 95 | ldap_tls_ciphers: '' 96 | ldap_tls_crlcheck: '' 97 | ldap_tls_key: '' 98 | ldap_tls_randfile: '' 99 | ldap_tls_reqcert: '' 100 | ldap_username: '' 101 | listen_interfaces: 102 | - em1 103 | - em2 104 | log_facility: local7 105 | lookup: 106 | enable: false 107 | max_lease_time: 7200 108 | one_lease_per_client: '' 109 | routers: [] 110 | server: dhcp 111 | server_identifier: '' 112 | server_name: '' 113 | service: dhcpd 114 | service_config: /etc/systemd/system/dhcpd.service.d/override.conf 115 | shared_networks: 116 | 224-29: 117 | pools: 118 | - allow: members of "foo" 119 | range: 120 | - 10.17.224.10 121 | - 10.17.224.250 122 | - deny: members of "foo" 123 | range: 124 | - 10.0.29.10 125 | - 10.0.29.230 126 | subnets: 127 | 10.0.29.0: 128 | netmask: 255.255.255.0 129 | routers: rtr-29.example.org 130 | 10.17.224.0: 131 | netmask: 255.255.255.0 132 | routers: rtr-224.example.org 133 | subnet_mask: '' 134 | subnets: 135 | 10.152.187.0: 136 | comment: 'No service will be given on this subnet, but declaring it helps 137 | the 138 | 139 | DHCP server to understand the network topology.' 140 | netmask: 255.255.255.0 141 | pools: 142 | - failover_peer: dhcp-failover 143 | range: 144 | - 10.152.187.1 145 | - 10.152.187.254 146 | 10.254.239.0: 147 | comment: This is a very basic subnet declaration. 148 | netmask: 255.255.255.224 149 | range: 150 | - 10.254.239.10 151 | - 10.254.239.20 152 | routers: 153 | - rtr-239-0-1.example.org 154 | - rtr-239-0-2.example.org 155 | 10.254.239.32: 156 | broadcast_address: 10.254.239.31 157 | comment: 'This declaration allows BOOTP clients to get dynamic addresses, 158 | 159 | which we don''t really recommend.' 160 | dynamic_bootp: true 161 | netmask: 255.255.255.224 162 | range: 163 | - 10.254.239.40 164 | - 10.254.239.60 165 | routers: rtr-239-32-1.example.org 166 | 10.5.5.0: 167 | broadcast_address: 10.5.5.31 168 | comment: A slightly different configuration for an internal subnet. 169 | default_lease_time: 600 170 | domain_name: internal.example.org 171 | domain_name_servers: 172 | - ns1.internal.example.org 173 | hosts: 174 | jake: 175 | comment: Hosts can be specified for subnets, taking subnets defaults 176 | fixed_address: 10.5.5.27 177 | hardware: ethernet 08:00:a7:26:c0:a9 178 | max_lease_time: 7200 179 | netmask: 255.255.255.224 180 | range: 181 | - 10.5.5.26 182 | - 10.5.5.30 183 | routers: 184 | - 10.5.5.1 185 | update_static_leases: false 186 | use_host_decl_names: false 187 | zones: {} 188 | -------------------------------------------------------------------------------- /test/integration/default/files/_mapdata/ubuntu-16.yaml: -------------------------------------------------------------------------------- 1 | # yamllint disable rule:indentation rule:line-length 2 | # Ubuntu-16.04 3 | --- 4 | values: 5 | allow: 6 | - booting 7 | - bootp 8 | arch: amd64 9 | authoritative: false 10 | classes: 11 | foo: 12 | comment: 'You can declare a class of clients and then do address allocation 13 | 14 | based on that. The example below shows a case where all clients 15 | 16 | in a certain class get addresses on the 10.17.224/24 subnet, and all 17 | 18 | other clients get addresses on the 10.0.29/24 subnet.' 19 | match: if substring (option vendor-class-identifier, 0, 4) = "SUNW" 20 | config: /etc/dhcp/dhcpd.conf 21 | customized_options: 22 | auto_proxy_config: 23 | code: 252 24 | type: string 25 | ddns_domainname: '' 26 | ddns_rev_domainname: '' 27 | ddns_update_style: '' 28 | default_lease_time: 600 29 | deny: unknown-clients 30 | domain_name: example.org 31 | domain_name_servers: 32 | - ns1.example.org 33 | - ns2.example.org 34 | domain_search: [] 35 | enable: false 36 | failover_peers: 37 | dhcp-failover: 38 | address: 10.152.187.5 39 | mclt: 3600 40 | peer_address: 10.152.187.6 41 | peer_port: 647 42 | port: 647 43 | primary: true 44 | split: 128 45 | get_lease_hostnames: '' 46 | hosts: 47 | fantasia: 48 | comment: 'Fixed IP addresses can also be specified for hosts. These addresses 49 | 50 | should not also be listed as being available for dynamic assignment. 51 | 52 | Hosts for which fixed IP addresses have been specified can boot using 53 | 54 | BOOTP or DHCP. Hosts for which no fixed address is specified can only 55 | 56 | be booted with DHCP, unless there is an address range on the subnet 57 | 58 | to which a BOOTP client is connected which has the dynamic-bootp flag 59 | 60 | set.' 61 | fixed_address: fantasia.fugue.com 62 | hardware: ethernet 08:00:07:26:c0:a5 63 | joe: 64 | comment: 'The hostname for a host can be passed in the DHCP response. Using 65 | the 66 | 67 | host_name key sets option host-name in the dhcpd configuration.' 68 | fixed_address: joe.fugue.com 69 | hardware: ethernet 08:00:2b:4c:29:32 70 | host_name: joe 71 | passacaglia: 72 | comment: 'Hosts which require special configuration options can be listed 73 | in 74 | 75 | host statements. If no address is specified, the address will be 76 | 77 | allocated dynamically (if possible), but the host-specific information 78 | 79 | will still come from the host declaration.' 80 | filename: vmunix.passacaglia 81 | hardware: ethernet 0:0:c0:5d:bd:95 82 | server_name: toccata.fugue.com 83 | keys: {} 84 | ldap_base_dn: '' 85 | ldap_debug_file: '' 86 | ldap_init_retry: 0 87 | ldap_method: '' 88 | ldap_password: '' 89 | ldap_port: '' 90 | ldap_server: '' 91 | ldap_ssl: '' 92 | ldap_tls_ca_dir: '' 93 | ldap_tls_ca_file: '' 94 | ldap_tls_cert: '' 95 | ldap_tls_ciphers: '' 96 | ldap_tls_crlcheck: '' 97 | ldap_tls_key: '' 98 | ldap_tls_randfile: '' 99 | ldap_tls_reqcert: '' 100 | ldap_username: '' 101 | listen_interfaces: 102 | - em1 103 | - em2 104 | log_facility: local7 105 | lookup: 106 | enable: false 107 | max_lease_time: 7200 108 | one_lease_per_client: '' 109 | routers: [] 110 | server: isc-dhcp-server 111 | server_identifier: '' 112 | server_name: '' 113 | service: isc-dhcp-server 114 | service_config: /etc/default/isc-dhcp-server 115 | shared_networks: 116 | 224-29: 117 | pools: 118 | - allow: members of "foo" 119 | range: 120 | - 10.17.224.10 121 | - 10.17.224.250 122 | - deny: members of "foo" 123 | range: 124 | - 10.0.29.10 125 | - 10.0.29.230 126 | subnets: 127 | 10.0.29.0: 128 | netmask: 255.255.255.0 129 | routers: rtr-29.example.org 130 | 10.17.224.0: 131 | netmask: 255.255.255.0 132 | routers: rtr-224.example.org 133 | subnet_mask: '' 134 | subnets: 135 | 10.152.187.0: 136 | comment: 'No service will be given on this subnet, but declaring it helps 137 | the 138 | 139 | DHCP server to understand the network topology.' 140 | netmask: 255.255.255.0 141 | pools: 142 | - failover_peer: dhcp-failover 143 | range: 144 | - 10.152.187.1 145 | - 10.152.187.254 146 | 10.254.239.0: 147 | comment: This is a very basic subnet declaration. 148 | netmask: 255.255.255.224 149 | range: 150 | - 10.254.239.10 151 | - 10.254.239.20 152 | routers: 153 | - rtr-239-0-1.example.org 154 | - rtr-239-0-2.example.org 155 | 10.254.239.32: 156 | broadcast_address: 10.254.239.31 157 | comment: 'This declaration allows BOOTP clients to get dynamic addresses, 158 | 159 | which we don''t really recommend.' 160 | dynamic_bootp: true 161 | netmask: 255.255.255.224 162 | range: 163 | - 10.254.239.40 164 | - 10.254.239.60 165 | routers: rtr-239-32-1.example.org 166 | 10.5.5.0: 167 | broadcast_address: 10.5.5.31 168 | comment: A slightly different configuration for an internal subnet. 169 | default_lease_time: 600 170 | domain_name: internal.example.org 171 | domain_name_servers: 172 | - ns1.internal.example.org 173 | hosts: 174 | jake: 175 | comment: Hosts can be specified for subnets, taking subnets defaults 176 | fixed_address: 10.5.5.27 177 | hardware: ethernet 08:00:a7:26:c0:a9 178 | max_lease_time: 7200 179 | netmask: 255.255.255.224 180 | range: 181 | - 10.5.5.26 182 | - 10.5.5.30 183 | routers: 184 | - 10.5.5.1 185 | update_static_leases: false 186 | use_host_decl_names: false 187 | zones: {} 188 | -------------------------------------------------------------------------------- /test/integration/default/files/_mapdata/ubuntu-18.yaml: -------------------------------------------------------------------------------- 1 | # yamllint disable rule:indentation rule:line-length 2 | # Ubuntu-18.04 3 | --- 4 | values: 5 | allow: 6 | - booting 7 | - bootp 8 | arch: amd64 9 | authoritative: false 10 | classes: 11 | foo: 12 | comment: 'You can declare a class of clients and then do address allocation 13 | 14 | based on that. The example below shows a case where all clients 15 | 16 | in a certain class get addresses on the 10.17.224/24 subnet, and all 17 | 18 | other clients get addresses on the 10.0.29/24 subnet.' 19 | match: if substring (option vendor-class-identifier, 0, 4) = "SUNW" 20 | config: /etc/dhcp/dhcpd.conf 21 | customized_options: 22 | auto_proxy_config: 23 | code: 252 24 | type: string 25 | ddns_domainname: '' 26 | ddns_rev_domainname: '' 27 | ddns_update_style: '' 28 | default_lease_time: 600 29 | deny: unknown-clients 30 | domain_name: example.org 31 | domain_name_servers: 32 | - ns1.example.org 33 | - ns2.example.org 34 | domain_search: [] 35 | enable: false 36 | failover_peers: 37 | dhcp-failover: 38 | address: 10.152.187.5 39 | mclt: 3600 40 | peer_address: 10.152.187.6 41 | peer_port: 647 42 | port: 647 43 | primary: true 44 | split: 128 45 | get_lease_hostnames: '' 46 | hosts: 47 | fantasia: 48 | comment: 'Fixed IP addresses can also be specified for hosts. These addresses 49 | 50 | should not also be listed as being available for dynamic assignment. 51 | 52 | Hosts for which fixed IP addresses have been specified can boot using 53 | 54 | BOOTP or DHCP. Hosts for which no fixed address is specified can only 55 | 56 | be booted with DHCP, unless there is an address range on the subnet 57 | 58 | to which a BOOTP client is connected which has the dynamic-bootp flag 59 | 60 | set.' 61 | fixed_address: fantasia.fugue.com 62 | hardware: ethernet 08:00:07:26:c0:a5 63 | joe: 64 | comment: 'The hostname for a host can be passed in the DHCP response. Using 65 | the 66 | 67 | host_name key sets option host-name in the dhcpd configuration.' 68 | fixed_address: joe.fugue.com 69 | hardware: ethernet 08:00:2b:4c:29:32 70 | host_name: joe 71 | passacaglia: 72 | comment: 'Hosts which require special configuration options can be listed 73 | in 74 | 75 | host statements. If no address is specified, the address will be 76 | 77 | allocated dynamically (if possible), but the host-specific information 78 | 79 | will still come from the host declaration.' 80 | filename: vmunix.passacaglia 81 | hardware: ethernet 0:0:c0:5d:bd:95 82 | server_name: toccata.fugue.com 83 | keys: {} 84 | ldap_base_dn: '' 85 | ldap_debug_file: '' 86 | ldap_init_retry: 0 87 | ldap_method: '' 88 | ldap_password: '' 89 | ldap_port: '' 90 | ldap_server: '' 91 | ldap_ssl: '' 92 | ldap_tls_ca_dir: '' 93 | ldap_tls_ca_file: '' 94 | ldap_tls_cert: '' 95 | ldap_tls_ciphers: '' 96 | ldap_tls_crlcheck: '' 97 | ldap_tls_key: '' 98 | ldap_tls_randfile: '' 99 | ldap_tls_reqcert: '' 100 | ldap_username: '' 101 | listen_interfaces: 102 | - em1 103 | - em2 104 | log_facility: local7 105 | lookup: 106 | enable: false 107 | max_lease_time: 7200 108 | one_lease_per_client: '' 109 | routers: [] 110 | server: isc-dhcp-server 111 | server_identifier: '' 112 | server_name: '' 113 | service: isc-dhcp-server 114 | service_config: /etc/default/isc-dhcp-server 115 | shared_networks: 116 | 224-29: 117 | pools: 118 | - allow: members of "foo" 119 | range: 120 | - 10.17.224.10 121 | - 10.17.224.250 122 | - deny: members of "foo" 123 | range: 124 | - 10.0.29.10 125 | - 10.0.29.230 126 | subnets: 127 | 10.0.29.0: 128 | netmask: 255.255.255.0 129 | routers: rtr-29.example.org 130 | 10.17.224.0: 131 | netmask: 255.255.255.0 132 | routers: rtr-224.example.org 133 | subnet_mask: '' 134 | subnets: 135 | 10.152.187.0: 136 | comment: 'No service will be given on this subnet, but declaring it helps 137 | the 138 | 139 | DHCP server to understand the network topology.' 140 | netmask: 255.255.255.0 141 | pools: 142 | - failover_peer: dhcp-failover 143 | range: 144 | - 10.152.187.1 145 | - 10.152.187.254 146 | 10.254.239.0: 147 | comment: This is a very basic subnet declaration. 148 | netmask: 255.255.255.224 149 | range: 150 | - 10.254.239.10 151 | - 10.254.239.20 152 | routers: 153 | - rtr-239-0-1.example.org 154 | - rtr-239-0-2.example.org 155 | 10.254.239.32: 156 | broadcast_address: 10.254.239.31 157 | comment: 'This declaration allows BOOTP clients to get dynamic addresses, 158 | 159 | which we don''t really recommend.' 160 | dynamic_bootp: true 161 | netmask: 255.255.255.224 162 | range: 163 | - 10.254.239.40 164 | - 10.254.239.60 165 | routers: rtr-239-32-1.example.org 166 | 10.5.5.0: 167 | broadcast_address: 10.5.5.31 168 | comment: A slightly different configuration for an internal subnet. 169 | default_lease_time: 600 170 | domain_name: internal.example.org 171 | domain_name_servers: 172 | - ns1.internal.example.org 173 | hosts: 174 | jake: 175 | comment: Hosts can be specified for subnets, taking subnets defaults 176 | fixed_address: 10.5.5.27 177 | hardware: ethernet 08:00:a7:26:c0:a9 178 | max_lease_time: 7200 179 | netmask: 255.255.255.224 180 | range: 181 | - 10.5.5.26 182 | - 10.5.5.30 183 | routers: 184 | - 10.5.5.1 185 | update_static_leases: false 186 | use_host_decl_names: false 187 | zones: {} 188 | -------------------------------------------------------------------------------- /test/integration/default/files/_mapdata/ubuntu-20.yaml: -------------------------------------------------------------------------------- 1 | # yamllint disable rule:indentation rule:line-length 2 | # Ubuntu-20.04 3 | --- 4 | values: 5 | allow: 6 | - booting 7 | - bootp 8 | arch: amd64 9 | authoritative: false 10 | classes: 11 | foo: 12 | comment: 'You can declare a class of clients and then do address allocation 13 | 14 | based on that. The example below shows a case where all clients 15 | 16 | in a certain class get addresses on the 10.17.224/24 subnet, and all 17 | 18 | other clients get addresses on the 10.0.29/24 subnet.' 19 | match: if substring (option vendor-class-identifier, 0, 4) = "SUNW" 20 | config: /etc/dhcp/dhcpd.conf 21 | customized_options: 22 | auto_proxy_config: 23 | code: 252 24 | type: string 25 | ddns_domainname: '' 26 | ddns_rev_domainname: '' 27 | ddns_update_style: '' 28 | default_lease_time: 600 29 | deny: unknown-clients 30 | domain_name: example.org 31 | domain_name_servers: 32 | - ns1.example.org 33 | - ns2.example.org 34 | domain_search: [] 35 | enable: false 36 | failover_peers: 37 | dhcp-failover: 38 | address: 10.152.187.5 39 | mclt: 3600 40 | peer_address: 10.152.187.6 41 | peer_port: 647 42 | port: 647 43 | primary: true 44 | split: 128 45 | get_lease_hostnames: '' 46 | hosts: 47 | fantasia: 48 | comment: 'Fixed IP addresses can also be specified for hosts. These addresses 49 | 50 | should not also be listed as being available for dynamic assignment. 51 | 52 | Hosts for which fixed IP addresses have been specified can boot using 53 | 54 | BOOTP or DHCP. Hosts for which no fixed address is specified can only 55 | 56 | be booted with DHCP, unless there is an address range on the subnet 57 | 58 | to which a BOOTP client is connected which has the dynamic-bootp flag 59 | 60 | set.' 61 | fixed_address: fantasia.fugue.com 62 | hardware: ethernet 08:00:07:26:c0:a5 63 | joe: 64 | comment: 'The hostname for a host can be passed in the DHCP response. Using 65 | the 66 | 67 | host_name key sets option host-name in the dhcpd configuration.' 68 | fixed_address: joe.fugue.com 69 | hardware: ethernet 08:00:2b:4c:29:32 70 | host_name: joe 71 | passacaglia: 72 | comment: 'Hosts which require special configuration options can be listed 73 | in 74 | 75 | host statements. If no address is specified, the address will be 76 | 77 | allocated dynamically (if possible), but the host-specific information 78 | 79 | will still come from the host declaration.' 80 | filename: vmunix.passacaglia 81 | hardware: ethernet 0:0:c0:5d:bd:95 82 | server_name: toccata.fugue.com 83 | keys: {} 84 | ldap_base_dn: '' 85 | ldap_debug_file: '' 86 | ldap_init_retry: 0 87 | ldap_method: '' 88 | ldap_password: '' 89 | ldap_port: '' 90 | ldap_server: '' 91 | ldap_ssl: '' 92 | ldap_tls_ca_dir: '' 93 | ldap_tls_ca_file: '' 94 | ldap_tls_cert: '' 95 | ldap_tls_ciphers: '' 96 | ldap_tls_crlcheck: '' 97 | ldap_tls_key: '' 98 | ldap_tls_randfile: '' 99 | ldap_tls_reqcert: '' 100 | ldap_username: '' 101 | listen_interfaces: 102 | - em1 103 | - em2 104 | log_facility: local7 105 | lookup: 106 | enable: false 107 | max_lease_time: 7200 108 | one_lease_per_client: '' 109 | routers: [] 110 | server: isc-dhcp-server 111 | server_identifier: '' 112 | server_name: '' 113 | service: isc-dhcp-server 114 | service_config: /etc/default/isc-dhcp-server 115 | shared_networks: 116 | 224-29: 117 | pools: 118 | - allow: members of "foo" 119 | range: 120 | - 10.17.224.10 121 | - 10.17.224.250 122 | - deny: members of "foo" 123 | range: 124 | - 10.0.29.10 125 | - 10.0.29.230 126 | subnets: 127 | 10.0.29.0: 128 | netmask: 255.255.255.0 129 | routers: rtr-29.example.org 130 | 10.17.224.0: 131 | netmask: 255.255.255.0 132 | routers: rtr-224.example.org 133 | subnet_mask: '' 134 | subnets: 135 | 10.152.187.0: 136 | comment: 'No service will be given on this subnet, but declaring it helps 137 | the 138 | 139 | DHCP server to understand the network topology.' 140 | netmask: 255.255.255.0 141 | pools: 142 | - failover_peer: dhcp-failover 143 | range: 144 | - 10.152.187.1 145 | - 10.152.187.254 146 | 10.254.239.0: 147 | comment: This is a very basic subnet declaration. 148 | netmask: 255.255.255.224 149 | range: 150 | - 10.254.239.10 151 | - 10.254.239.20 152 | routers: 153 | - rtr-239-0-1.example.org 154 | - rtr-239-0-2.example.org 155 | 10.254.239.32: 156 | broadcast_address: 10.254.239.31 157 | comment: 'This declaration allows BOOTP clients to get dynamic addresses, 158 | 159 | which we don''t really recommend.' 160 | dynamic_bootp: true 161 | netmask: 255.255.255.224 162 | range: 163 | - 10.254.239.40 164 | - 10.254.239.60 165 | routers: rtr-239-32-1.example.org 166 | 10.5.5.0: 167 | broadcast_address: 10.5.5.31 168 | comment: A slightly different configuration for an internal subnet. 169 | default_lease_time: 600 170 | domain_name: internal.example.org 171 | domain_name_servers: 172 | - ns1.internal.example.org 173 | hosts: 174 | jake: 175 | comment: Hosts can be specified for subnets, taking subnets defaults 176 | fixed_address: 10.5.5.27 177 | hardware: ethernet 08:00:a7:26:c0:a9 178 | max_lease_time: 7200 179 | netmask: 255.255.255.224 180 | range: 181 | - 10.5.5.26 182 | - 10.5.5.30 183 | routers: 184 | - 10.5.5.1 185 | update_static_leases: false 186 | use_host_decl_names: false 187 | zones: {} 188 | -------------------------------------------------------------------------------- /test/integration/default/files/_mapdata/ubuntu-22.yaml: -------------------------------------------------------------------------------- 1 | # yamllint disable rule:indentation rule:line-length 2 | # Ubuntu-22.04 3 | --- 4 | values: 5 | allow: 6 | - booting 7 | - bootp 8 | arch: amd64 9 | authoritative: false 10 | classes: 11 | foo: 12 | comment: 'You can declare a class of clients and then do address allocation 13 | 14 | based on that. The example below shows a case where all clients 15 | 16 | in a certain class get addresses on the 10.17.224/24 subnet, and all 17 | 18 | other clients get addresses on the 10.0.29/24 subnet.' 19 | match: if substring (option vendor-class-identifier, 0, 4) = "SUNW" 20 | config: /etc/dhcp/dhcpd.conf 21 | customized_options: 22 | auto_proxy_config: 23 | code: 252 24 | type: string 25 | ddns_domainname: '' 26 | ddns_rev_domainname: '' 27 | ddns_update_style: '' 28 | default_lease_time: 600 29 | deny: unknown-clients 30 | domain_name: example.org 31 | domain_name_servers: 32 | - ns1.example.org 33 | - ns2.example.org 34 | domain_search: [] 35 | enable: false 36 | failover_peers: 37 | dhcp-failover: 38 | address: 10.152.187.5 39 | mclt: 3600 40 | peer_address: 10.152.187.6 41 | peer_port: 647 42 | port: 647 43 | primary: true 44 | split: 128 45 | get_lease_hostnames: '' 46 | hosts: 47 | fantasia: 48 | comment: 'Fixed IP addresses can also be specified for hosts. These addresses 49 | 50 | should not also be listed as being available for dynamic assignment. 51 | 52 | Hosts for which fixed IP addresses have been specified can boot using 53 | 54 | BOOTP or DHCP. Hosts for which no fixed address is specified can only 55 | 56 | be booted with DHCP, unless there is an address range on the subnet 57 | 58 | to which a BOOTP client is connected which has the dynamic-bootp flag 59 | 60 | set.' 61 | fixed_address: fantasia.fugue.com 62 | hardware: ethernet 08:00:07:26:c0:a5 63 | joe: 64 | comment: 'The hostname for a host can be passed in the DHCP response. Using 65 | the 66 | 67 | host_name key sets option host-name in the dhcpd configuration.' 68 | fixed_address: joe.fugue.com 69 | hardware: ethernet 08:00:2b:4c:29:32 70 | host_name: joe 71 | passacaglia: 72 | comment: 'Hosts which require special configuration options can be listed 73 | in 74 | 75 | host statements. If no address is specified, the address will be 76 | 77 | allocated dynamically (if possible), but the host-specific information 78 | 79 | will still come from the host declaration.' 80 | filename: vmunix.passacaglia 81 | hardware: ethernet 0:0:c0:5d:bd:95 82 | server_name: toccata.fugue.com 83 | keys: {} 84 | ldap_base_dn: '' 85 | ldap_debug_file: '' 86 | ldap_init_retry: 0 87 | ldap_method: '' 88 | ldap_password: '' 89 | ldap_port: '' 90 | ldap_server: '' 91 | ldap_ssl: '' 92 | ldap_tls_ca_dir: '' 93 | ldap_tls_ca_file: '' 94 | ldap_tls_cert: '' 95 | ldap_tls_ciphers: '' 96 | ldap_tls_crlcheck: '' 97 | ldap_tls_key: '' 98 | ldap_tls_randfile: '' 99 | ldap_tls_reqcert: '' 100 | ldap_username: '' 101 | listen_interfaces: 102 | - em1 103 | - em2 104 | log_facility: local7 105 | lookup: 106 | enable: false 107 | max_lease_time: 7200 108 | one_lease_per_client: '' 109 | routers: [] 110 | server: isc-dhcp-server 111 | server_identifier: '' 112 | server_name: '' 113 | service: isc-dhcp-server 114 | service_config: /etc/default/isc-dhcp-server 115 | shared_networks: 116 | 224-29: 117 | pools: 118 | - allow: members of "foo" 119 | range: 120 | - 10.17.224.10 121 | - 10.17.224.250 122 | - deny: members of "foo" 123 | range: 124 | - 10.0.29.10 125 | - 10.0.29.230 126 | subnets: 127 | 10.0.29.0: 128 | netmask: 255.255.255.0 129 | routers: rtr-29.example.org 130 | 10.17.224.0: 131 | netmask: 255.255.255.0 132 | routers: rtr-224.example.org 133 | subnet_mask: '' 134 | subnets: 135 | 10.152.187.0: 136 | comment: 'No service will be given on this subnet, but declaring it helps 137 | the 138 | 139 | DHCP server to understand the network topology.' 140 | netmask: 255.255.255.0 141 | pools: 142 | - failover_peer: dhcp-failover 143 | range: 144 | - 10.152.187.1 145 | - 10.152.187.254 146 | 10.254.239.0: 147 | comment: This is a very basic subnet declaration. 148 | netmask: 255.255.255.224 149 | range: 150 | - 10.254.239.10 151 | - 10.254.239.20 152 | routers: 153 | - rtr-239-0-1.example.org 154 | - rtr-239-0-2.example.org 155 | 10.254.239.32: 156 | broadcast_address: 10.254.239.31 157 | comment: 'This declaration allows BOOTP clients to get dynamic addresses, 158 | 159 | which we don''t really recommend.' 160 | dynamic_bootp: true 161 | netmask: 255.255.255.224 162 | range: 163 | - 10.254.239.40 164 | - 10.254.239.60 165 | routers: rtr-239-32-1.example.org 166 | 10.5.5.0: 167 | broadcast_address: 10.5.5.31 168 | comment: A slightly different configuration for an internal subnet. 169 | default_lease_time: 600 170 | domain_name: internal.example.org 171 | domain_name_servers: 172 | - ns1.internal.example.org 173 | hosts: 174 | jake: 175 | comment: Hosts can be specified for subnets, taking subnets defaults 176 | fixed_address: 10.5.5.27 177 | hardware: ethernet 08:00:a7:26:c0:a9 178 | max_lease_time: 7200 179 | netmask: 255.255.255.224 180 | range: 181 | - 10.5.5.26 182 | - 10.5.5.30 183 | routers: 184 | - 10.5.5.1 185 | update_static_leases: false 186 | use_host_decl_names: false 187 | zones: {} 188 | -------------------------------------------------------------------------------- /test/integration/default/inspec.yml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | name: default 5 | title: dhcpd formula 6 | maintainer: SaltStack Formulas 7 | license: Apache-2.0 8 | summary: Verify that the dhcpd formula is setup and configured correctly 9 | depends: 10 | - name: share 11 | path: test/integration/share 12 | supports: 13 | - platform-name: debian 14 | - platform-name: ubuntu 15 | - platform-name: centos 16 | - platform-name: fedora 17 | - platform-name: opensuse 18 | - platform-name: suse 19 | - platform-name: freebsd 20 | - platform-name: openbsd 21 | - platform-name: amazon 22 | - platform-name: oracle 23 | - platform-name: arch 24 | - platform-name: gentoo 25 | - platform-name: almalinux 26 | - platform-name: rocky 27 | - platform-name: mac_os_x 28 | - platform: windows 29 | -------------------------------------------------------------------------------- /test/integration/share/README.md: -------------------------------------------------------------------------------- 1 | # InSpec Profile: `share` 2 | 3 | This shows the implementation of the `share` InSpec [profile](https://github.com/inspec/inspec/blob/master/docs/profiles.md). 4 | 5 | Its goal is to share the libraries between all profiles. 6 | 7 | ## Libraries 8 | 9 | ### `system` 10 | 11 | The `system` library provides easy access to system dependent information: 12 | 13 | - `system.platform`: based on `inspec.platform`, modify to values that are more consistent from a SaltStack perspective 14 | - `system.platform[:family]` provide a family name for Arch and Gentoo 15 | - `system.platform[:name]` append `linux` to both `amazon` and `oracle`; ensure Windows platforms are resolved as simply `windows` 16 | - `system.platform[:release]` tweak Arch, Amazon Linux, Gentoo, openSUSE and Windows: 17 | - `Arch` is always `base-latest` 18 | - `Amazon Linux` release `2018` is resolved as `1` 19 | - `Gentoo` release is trimmed to its major version number and then the init system is appended (i.e. `sysv` or `sysd`) 20 | - `openSUSE` is resolved as `tumbleweed` if the `platform[:release]` is in date format 21 | - `Windows` uses the widely-used release number (e.g. `8.1` or `2019-server`) in place of the actual system release version 22 | - `system.platform[:finger]` is the concatenation of the name and the major release number (except for Ubuntu, which gives `ubuntu-20.04` for example) 23 | -------------------------------------------------------------------------------- /test/integration/share/inspec.yml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | name: share 5 | title: InSpec shared resources 6 | maintainer: SaltStack Formulas 7 | license: Apache-2.0 8 | summary: shared resources 9 | supports: 10 | - platform-name: debian 11 | - platform-name: ubuntu 12 | - platform-name: centos 13 | - platform-name: fedora 14 | - platform-name: opensuse 15 | - platform-name: suse 16 | - platform-name: freebsd 17 | - platform-name: openbsd 18 | - platform-name: amazon 19 | - platform-name: oracle 20 | - platform-name: arch 21 | - platform-name: gentoo 22 | - platform-name: almalinux 23 | - platform-name: rocky 24 | - platform-name: mac_os_x 25 | - platform: windows 26 | -------------------------------------------------------------------------------- /test/integration/share/libraries/system.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # system.rb -- InSpec resources for system values 4 | # Author: Daniel Dehennin 5 | # Copyright (C) 2020 Daniel Dehennin 6 | 7 | # rubocop:disable Metrics/ClassLength 8 | class SystemResource < Inspec.resource(1) 9 | name 'system' 10 | 11 | attr_reader :platform 12 | 13 | def initialize 14 | super 15 | @platform = build_platform 16 | end 17 | 18 | private 19 | 20 | def build_platform 21 | { 22 | family: build_platform_family, 23 | name: build_platform_name, 24 | release: build_platform_release, 25 | finger: build_platform_finger, 26 | codename: build_platform_codename 27 | } 28 | end 29 | 30 | def build_platform_family 31 | case inspec.platform[:name] 32 | when 'arch', 'gentoo' 33 | inspec.platform[:name] 34 | else 35 | inspec.platform[:family] 36 | end 37 | end 38 | 39 | def build_platform_name 40 | case inspec.platform[:name] 41 | when 'amazon', 'oracle', 'rocky' 42 | "#{inspec.platform[:name]}linux" 43 | when /^windows_/ 44 | inspec.platform[:family] 45 | else 46 | inspec.platform[:name] 47 | end 48 | end 49 | 50 | # rubocop:disable Metrics/MethodLength,Metrics/AbcSize,Metrics/CyclomaticComplexity 51 | def build_platform_release 52 | case inspec.platform[:name] 53 | when 'amazon' 54 | # `2018` relase is named `1` in `kitchen.yml` 55 | inspec.platform[:release].gsub(/2018.*/, '1') 56 | when 'arch' 57 | 'base-latest' 58 | when 'gentoo' 59 | "#{inspec.platform[:release].split('.')[0]}-#{derive_gentoo_init_system}" 60 | when 'mac_os_x' 61 | inspec.command('sw_vers -productVersion').stdout.to_s 62 | when 'opensuse' 63 | # rubocop:disable Style/NumericLiterals,Layout/LineLength 64 | inspec.platform[:release].to_i > 20210101 ? 'tumbleweed' : inspec.platform[:release] 65 | # rubocop:enable Style/NumericLiterals,Layout/LineLength 66 | when 'windows_8.1_pro' 67 | '8.1' 68 | when 'windows_server_2022_datacenter' 69 | '2022-server' 70 | when 'windows_server_2019_datacenter' 71 | '2019-server' 72 | when 'windows_server_2016_datacenter' 73 | '2016-server' 74 | else 75 | inspec.platform[:release] 76 | end 77 | end 78 | # rubocop:enable Metrics/MethodLength,Metrics/AbcSize,Metrics/CyclomaticComplexity 79 | 80 | def derive_gentoo_init_system 81 | inspec.command('systemctl').exist? ? 'sysd' : 'sysv' 82 | end 83 | 84 | def build_platform_finger 85 | "#{build_platform_name}-#{build_finger_release}" 86 | end 87 | 88 | def build_finger_release 89 | case inspec.platform[:name] 90 | when 'ubuntu' 91 | build_platform_release.split('.').slice(0, 2).join('.') 92 | else 93 | build_platform_release.split('.')[0] 94 | end 95 | end 96 | 97 | # rubocop:disable Metrics/MethodLength,Metrics/CyclomaticComplexity 98 | def build_platform_codename 99 | case build_platform_finger 100 | when 'ubuntu-22.04' 101 | 'jammy' 102 | when 'ubuntu-20.04' 103 | 'focal' 104 | when 'ubuntu-18.04' 105 | 'bionic' 106 | when 'debian-11' 107 | 'bullseye' 108 | when 'debian-10' 109 | 'buster' 110 | when 'debian-9' 111 | 'stretch' 112 | when 'almalinux-8' 113 | "AlmaLinux #{build_platform_release} (Arctic Sphynx)" 114 | when 'amazonlinux-2' 115 | 'Amazon Linux 2' 116 | when 'arch-base-latest' 117 | 'Arch Linux' 118 | when 'centos-7' 119 | 'CentOS Linux 7 (Core)' 120 | when 'centos-8' 121 | 'CentOS Stream 8' 122 | when 'opensuse-tumbleweed' 123 | 'openSUSE Tumbleweed' 124 | when 'opensuse-15' 125 | "openSUSE Leap #{build_platform_release}" 126 | when 'oraclelinux-8', 'oraclelinux-7' 127 | "Oracle Linux Server #{build_platform_release}" 128 | when 'gentoo-2-sysd', 'gentoo-2-sysv' 129 | 'Gentoo/Linux' 130 | when 'rockylinux-8' 131 | "Rocky Linux #{build_platform_release} (Green Obsidian)" 132 | else 133 | '' 134 | end 135 | end 136 | # rubocop:enable Metrics/MethodLength,Metrics/CyclomaticComplexity 137 | end 138 | # rubocop:enable Metrics/ClassLength 139 | --------------------------------------------------------------------------------