1
0

master.rst 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. .. meta::
  2. :status: review
  3. .. _spm-master:
  4. =======================
  5. Installing SPM Packages
  6. =======================
  7. SPM packages are installed to your Salt master, where they are available to Salt minions
  8. using all of Salt's package management functions.
  9. Configuring Remote Repositories
  10. ===============================
  11. Before SPM can use a repository, two things need to happen. First, the Salt master needs to
  12. know where the repository is through a configuration process. Then it needs to pull down the repository
  13. metadata.
  14. Repository Configuration Files
  15. ------------------------------
  16. Repositories are configured by adding each of them to the
  17. ``/etc/salt/spm.repos.d/spm.repo`` file on each Salt master. This file contains
  18. the name of the repository, and the link to the repository:
  19. .. code-block:: yaml
  20. my_repo:
  21. url: https://spm.example.com/
  22. For HTTP/HTTPS Basic authorization you can define credentials:
  23. .. code-block:: yaml
  24. my_repo:
  25. url: https://spm.example.com/
  26. username: user
  27. password: pass
  28. Beware of unauthorized access to this file, please set at least 0640 permissions for this configuration file:
  29. The URL can use ``http``, ``https``, ``ftp``, or ``file``.
  30. .. code-block:: yaml
  31. my_repo:
  32. url: file:///srv/spm_build
  33. Updating Local Repository Metadata
  34. ----------------------------------
  35. After the repository is configured on the Salt master, repository metadata is
  36. downloaded using the ``spm update_repo`` command:
  37. .. code-block:: bash
  38. spm update_repo
  39. .. note::
  40. A file for each repo is placed in ``/var/cache/salt/spm`` on the Salt master
  41. after you run the `update_repo` command. If you add a repository and it
  42. does not seem to be showing up, check this path to verify that the
  43. repository was found.
  44. Update File Roots
  45. =================
  46. SPM packages are installed to the ``srv/spm/salt`` folder on your Salt master.
  47. This path needs to be added to the file roots on your Salt master
  48. manually.
  49. .. code-block:: yaml
  50. file_roots:
  51. base:
  52. 1. /srv/salt
  53. 2. /srv/spm/salt
  54. Restart the salt-master service after updating the ``file_roots`` setting.
  55. Installing Packages
  56. ===================
  57. To install a package, use the ``spm install`` command:
  58. .. code-block:: bash
  59. spm install apache
  60. .. warning::
  61. Currently, SPM does not check to see if files are already in place before
  62. installing them. That means that existing files will be overwritten without
  63. warning.
  64. .. _spm-master-local:
  65. Installing directly from an SPM file
  66. ------------------------------------
  67. You can also install SPM packages using a local SPM file using the ``spm local
  68. install`` command:
  69. .. code-block:: bash
  70. spm local install /srv/spm/apache-201506-1.spm
  71. An SPM repository is not required when using `spm local install`.
  72. Pillars
  73. =======
  74. If an installed package includes Pillar data, be sure to target the installed
  75. pillar to the necessary systems using the pillar Top file.
  76. Removing Packages
  77. =================
  78. Packages may be removed after they are installed using the ``spm remove``
  79. command.
  80. .. code-block:: bash
  81. spm remove apache
  82. If files have been modified, they will not be removed. Empty directories will
  83. also be removed.