iscsi-formula

Travis CI Build Status Semantic Release

Configure iSCSI targets and initiator on GNU/Linux and FreeBSD.

1. General notes

If you are interested in writing or contributing to formulas, please pay attention to the Writing Formula Section.

If you want to use this formula, please pay attention to the FORMULA file and/or git tag, which contains the currently released version. This formula is versioned according to Semantic Versioning.

See Formula Versioning Section for more details.

2. Special Nodes

The scope of this formula is Ethernet/Block

Link/Transport and Storage protocol infographic

3. Contributing to this repo

Commit message formatting is significant!!

Please see How to contribute for more details.

4. Available Meta states

4.1. iscsi

Meta-state (This is a state that includes other states).

Deploy iSNS, iSCSI initiator, and iSCSI target packages, manage configuration files and then starts the associated iscsi services.

4.2. iscsi.target

Install and configure the iSCSI Target service. Supported vendor implementations include-

  • /etc/ctl.conf for ctld(8) on FreeBSD

  • /etc/target/saveconfig.json\ for`LIO`` on GNU/Linux

  • /etc/targets.conf for tgt(8) on GNU/Linux

  • /etc/ietd.conf for ietd(8)` on GNU/Linux

The defaults targets are-

  • ctld on FreeBSD

  • LIO on CentOS, OpenSUSE, Arch

  • tgt on Debian

  • Unsupported on Amazon (no packages available)

The default choice is modifable via the iscsi.target.provider pillar value. New providers can be introduced via pull request.

4.3. iscsi.target.clean

Meta-state (This is a state that includes other states).

this state will undo everything performed in the iscsi.target meta-state in reverse order, i.e. stops the service, removes the configuration files and then uninstalls the package.

4.4. iscsi.initiator

Install and configure the iSCSI initiator service-

  • /etc/iscsi.conf for FreeBSD

  • /etc/iscsi/iscsid.conf or ~/.iscsid.conf for Open iSCSI on GNU/Linux

4.5. iscsi.initiator.clean

Meta-state (This is a state that includes other states).

this state will undo everything performed in the iscsi.initiator meta-state in reverse order, i.e. stops the service, removes the configuration files and then uninstalls the package.

4.6. iscsi.isns

Install and configure iSCSI name service.

4.7. iscsi.isns.clean

Meta-state (This is a state that includes other states).

this state will undo everything performed in the iscsi.isns meta-state in reverse order, i.e. stops the service, removes the configuration files and then uninstalls the package.

5. Available sub-states

5.1. iscsi.target.package

Install iSCSI target related packages.

5.2. iscsi.target.package.clean

Remove iSCSI target related packages.

5.3. iscsi.target.config

Install iSCSI target related configuration files.

5.4. iscsi.target.config.clean

Remove iSCSI target related configuration files.

5.5. iscsi.target.kernel

Load iSCSI target related kernel modules.

5.6. iscsi.target.kernel.clean

Unload iSCSI target related kernel modules.

5.7. iscsi.target.make

Make iSCSI related packages from git source on FreeBSD.

5.8. iscsi.target.make.clean

Remove iSCSI related package binaries on FreeBSD.

5.9. iscsi.target.service

Install iSCSI target services.

5.10. iscsi.target.service.clean

Stop and disable SCSI target services.

5.11. iscsi.initiator.package

Install iSCSI initiator related packages.

5.12. iscsi.initiator.package.clean

Remove iSCSI initiator related packages.

5.13. iscsi.initiator.config

Install iSCSI initiator related configuration files.

5.14. iscsi.initiator.config.clean

Remove iSCSI initiator related configuration files.

5.15. iscsi.initiator.kernel

Load iSCSI initiator related kernel modules.

5.16. iscsi.initiator.kernel.clean

Unload iSCSI initiator related kernel modules.

5.17. iscsi.initiator.make

Make iSCSI related packages from git source for FreeBSD.

5.18. iscsi.initiator.make.clean

Remove iSCSI related package binaries on FreeBSD.

5.19. iscsi.initiator.service

Install iSCSI initiator services.

5.20. iscsi.initiator.service.clean

Stop and disable iSCSI initiator services.

5.21. iscsi.isns.package

Install iSCSI isns packages.

5.22. iscsi.isns.package.clean

Remove iSCSI isns packages.

5.23. iscsi.isns.config

Customises iscsi isns configuration. Requires iscsi.isns.package via include list.

5.24. iscsi.isns.config.clean

Remove iSCSI isns configuration files.

5.25. iscsi.isns.make

This state makes iscsi isns services on FreeBSD.

5.26. iscsi.isns.make.clean

Removes iSCSI isns binaries on FreeBSD.

5.27. iscsi.isns.service

Start iscsi isns services. Requires iscsi.isns.config via include list.

5.28. iscsi.isns.service.clean

Meta-state (This is a state that includes other states).

this state will undo everything performed in the iscsi.isns meta-state in reverse order, i.e. stops the service, removes the configuration files and then uninstalls the package.

6. Testing

Linux testing is done with kitchen-salt.

6.1. Requirements

  • Ruby

  • Docker

$ gem install bundler
$ bundle install
$ bin/kitchen test [platform]

Where [platform] is the platform name defined in kitchen.yml, e.g. debian-9-2019-2-py3.

6.2. bin/kitchen converge

Creates the docker instance and runs the iscsi main state, ready for testing.

6.3. bin/kitchen verify

Runs the inspec tests on the actual instance.

6.4. bin/kitchen destroy

Removes the docker instance.

6.5. bin/kitchen test

Runs all of the stages above in one go: i.e. destroy + converge
verify + destroy.

6.6. bin/kitchen login

Gives you SSH access to the instance for manual testing.