profiles.rst 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. .. _salt-cloud-profiles:
  2. VM Profiles
  3. ===========
  4. Salt cloud designates virtual machines inside the profile configuration file.
  5. The profile configuration file defaults to ``/etc/salt/cloud.profiles`` and is
  6. a yaml configuration. The syntax for declaring profiles is simple:
  7. .. code-block:: yaml
  8. fedora_rackspace:
  9. provider: my-rackspace-config
  10. image: Fedora 17
  11. size: 256 server
  12. script: bootstrap-salt
  13. It should be noted that the ``script`` option defaults to ``bootstrap-salt``,
  14. and does not normally need to be specified. Further examples in this document
  15. will not show the ``script`` option.
  16. A few key pieces of information need to be declared and can change based on the
  17. cloud provider. A number of additional parameters can also be inserted:
  18. .. code-block:: yaml
  19. centos_rackspace:
  20. provider: my-rackspace-config
  21. image: CentOS 6.2
  22. size: 1024 server
  23. minion:
  24. master: salt.example.com
  25. append_domain: webs.example.com
  26. grains:
  27. role: webserver
  28. The image must be selected from available images. Similarly, sizes must be
  29. selected from the list of sizes. To get a list of available images and sizes
  30. use the following command:
  31. .. code-block:: bash
  32. salt-cloud --list-images openstack
  33. salt-cloud --list-sizes openstack
  34. Some parameters can be specified in the main Salt cloud configuration file and
  35. then are applied to all cloud profiles. For instance if only a single cloud
  36. provider is being used then the provider option can be declared in the Salt
  37. cloud configuration file.
  38. Multiple Configuration Files
  39. ----------------------------
  40. In addition to ``/etc/salt/cloud.profiles``, profiles can also be specified in
  41. any file matching ``cloud.profiles.d/*conf`` which is a sub-directory relative
  42. to the profiles configuration file(with the above configuration file as an
  43. example, ``/etc/salt/cloud.profiles.d/*.conf``). This allows for more
  44. extensible configuration, and plays nicely with various configuration
  45. management tools as well as version control systems.
  46. Larger Example
  47. --------------
  48. .. code-block:: yaml
  49. rhel_ec2:
  50. provider: my-ec2-config
  51. image: ami-e565ba8c
  52. size: t1.micro
  53. minion:
  54. cheese: edam
  55. ubuntu_ec2:
  56. provider: my-ec2-config
  57. image: ami-7e2da54e
  58. size: t1.micro
  59. minion:
  60. cheese: edam
  61. ubuntu_rackspace:
  62. provider: my-rackspace-config
  63. image: Ubuntu 12.04 LTS
  64. size: 256 server
  65. minion:
  66. cheese: edam
  67. fedora_rackspace:
  68. provider: my-rackspace-config
  69. image: Fedora 17
  70. size: 256 server
  71. minion:
  72. cheese: edam
  73. cent_linode:
  74. provider: my-linode-config
  75. image: CentOS 6.2 64bit
  76. size: Linode 512
  77. cent_gogrid:
  78. provider: my-gogrid-config
  79. image: 12834
  80. size: 512MB
  81. cent_joyent:
  82. provider: my-joyent-config
  83. image: centos-7
  84. size: g4-highram-16G