Skip to content

Commit

Permalink
Merge pull request #327 from arista-eosplus/puppet
Browse files Browse the repository at this point in the history
Puppet bootstrap template for Cookbook
  • Loading branch information
devrobo committed Sep 8, 2015
2 parents 8be46b4 + cb94a4b commit c9e1632
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/ReleaseNotes1.4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Enhancements
- Plugin infrastructure for resource pool allocation (`121 <https://github.com/arista-eosplus/ztpserver/issues/121>`_)

Bug fixes
^^^^^^^^
^^^^^^^^^

* Starting ZTPServer fails because ``pkg_resources.DistributionNotFound: mock`` (`318 <https://github.com/arista-eosplus/ztpserver/issues/318>`_)

Expand Down
Binary file added docs/_static/arista_logo_11-trans-w.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
# of the sidebar.
#html_logo = None
#html_logo = '_static/AristaLogo.png'
html_logo = '_static/arista_logo_jpg-11.jpg'
html_logo = '_static/arista_logo_11-trans-w.png'

# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
Expand Down
1 change: 1 addition & 0 deletions docs/cookbook.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ ZTPServer Cookbook
cookbook/actions
cookbook/resourcePools
cookbook/advanced
cookbook/puppet
cookbook/ztpsVMonEOS
85 changes: 85 additions & 0 deletions docs/cookbook/puppet.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
Puppet Agent - Bootstrap EOS
============================

.. The line below adds a local TOC
.. contents:: :local:
:depth: 1

Bootstrap EOS to Puppet
-----------------------

Objective
^^^^^^^^^

I want to bootstrap an EOS node with the Puppet agent.

Solution
^^^^^^^^

.. note:: Prior to EOS 4.14.5, eAPI must be configured with HTTPS or HTTP and a flash:eapi.conf must be created for rbeapi. Starting with EOS 4.14.5, rbeapi can use unix-sockets to communicate with eAPI, locally.

Download the `Puppet Enterprise agent <https://puppetlabs.com/download-puppet-enterprise-all#agent>`_ (may be used with Puppet Enterprise or Open Source) from PuppetLabs and the `Ruby client for eAPI (pe-rbeapi) <https://github.com/arista-eosplus/rbeapi/releases>`_ SWIX from GitHub. Place these files in /usr/share/ztpserver/files/puppet/``

.. code-block:: yaml
---
name: puppet-test
actions:
-
name: "Install Puppet agent"
action: install_extension
always_execute: true
attributes:
url: files/puppet/puppet-enterprise-3.8.2-eos-4-i386.swix
-
name: "Install rbeapi - Ruby client for eAPI"
action: install_extension
always_execute: true
attributes:
url: files/puppet/rbeapi-0.3.0.swix
-
name: "Configure host alias and eAPI for Puppet"
action: add_config
attributes:
url: files/templates/puppet.template
variables:
hostname: allocate('mgmt_hostnames')
domainname: example.com
puppetmaster: 172.16.130.10
ntpserver: 66.175.209.17
onstart: "Starting to configure EOS for Puppet"
onsuccess: "SUCCESS: Base config for Puppet"
.. code-block:: console
!
alias puppet bash sudo /opt/puppet/bin/puppet
!
hostname $hostname
!
ip domain-name $domainname
!
ip host puppet $puppetmaster
!
ntp server $ntpserver prefer iburst
!
management api http-commands
no protocol https
protocol unix-socket
no shutdown
!
Explanation
^^^^^^^^^^^

Here we use the ``install_extension`` action to install the Puppet agent and
Ruby client for eAPI, then apply a minimal configuration so the Puppet agent
can generate its SSL keys and contact the Puppet Master. The attributes listed
in the ``add_config`` action will be passed to the node so that it is able to
properly generate its SSL keypair and certificate signing request (CSR) and
validate the Puppet master's certificate.

.. note:: For more Action recipes see the Actions section.

.. End of Bootstrap a Puppet node

0 comments on commit c9e1632

Please sign in to comment.