Skip to content

Commit

Permalink
Fixing syntax highlighting, adding org_mapper and support
Browse files Browse the repository at this point in the history
  • Loading branch information
adamhjk committed Feb 24, 2012
1 parent dba4a0f commit e49e473
Show file tree
Hide file tree
Showing 8 changed files with 473 additions and 63 deletions.
1 change: 1 addition & 0 deletions source/administration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ This section will guide you through the most common administrative tasks associa
administration/logs
administration/user_management
administration/high_availability
administration/org_mapper
administration/troubleshooting


Empty file.
98 changes: 98 additions & 0 deletions source/administration/org_mapper.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
=========
orgmapper
=========

.. warning::

**orgmapper** is not currently supported by default by Private Chef. It will be fully enabled in a future release - the documentation is included for your reference should an Opscode Support Engineer assist you in enabling it on your existing Private Chef infrastructure.

:command:`orgmapper` is a tool based on :command:`irb` (the ruby REPL) which provides
administrative access to the many of the back-end objects in Private Chef.

Starting orgmapper
------------------

Login to the server that is your Private Chef backend. (In an HA configuration, this should be the current HA primary.)

.. code-block:: bash
$ /opt/opscode/bin/orgmapper /etc/opscode/orgmapper.conf
You can then query organizations, users, etc through methods like:

.. code-block:: ruby
orgmapper:0 > pp ORGS.all
orgmapper:0 > pp ORGS['ORGNAME']
orgmapper:0 > pp USERS.all
orgmapper:0 > pp USERS['USER']
Where ``ORGNAME`` is an organization short name, and ``USER`` is a username.


Determine the Users in an Organization
--------------------------------------

.. code-block:: ruby
orgmapper:0 > OrganizationUser.users_for_organization(ORGS['ORGNAME']).collect do |orguser|
Mixlib::Authorization::Models::User.get(orguser)["username"]
end
Replace ``ORGNAME`` with the organization's short name.

Determine the Organizations for a User
--------------------------------------
.. code-block:: ruby
orgmapper:0 > OrganizationUser.organizations_for_user(USERS['USERNAME']).collect do |orguser|
Mixlib::Authorization::Models::Organization.get(orguser)["name"]
end
Replace ``USERNAME`` with the username.

Determine a Username based on an Email Address
----------------------------------------------
.. code-block:: ruby
orgmapper:0 > USERS.select{|u| u['email'] == '[email protected]'}
Replace ``[email protected]`` with the email address.

Associate a User to an Organization
-----------------------------------

Make sure the user and the organization both exist, then:

.. code-block:: ruby
orgmapper:0 > OrgMapper::Associator.associate_user(ORGS['ORGNAME'], USERS['USERNAME'])
Replace ``ORGNAME`` with the organization, and ``USERNAME`` with the username you want to associate.

Add a User to an Organization's Admins Group
--------------------------------------------

.. code-block:: ruby
orgmapper:0> ORGS['ORGNAME'].add_user_to_group('USERNAME', 'admins')
Replace ``ORGNAME`` with the organization, and ``USERNAME`` with the username.

Remove a User to an Organization's Admins Group
-----------------------------------------------

.. code-block:: ruby
orgmapper:0> ORGS['ORGNAME'].remove_user_from_group('USERNAME', 'admins')
Delete a User
-------------

.. code-block:: ruby
orgmapper:0 > USERS['USERNAME']
orgmapper:0 > USERS['USERNAME'].destroy
Replace ``USERNAME`` with the username you want to delete.

2 changes: 1 addition & 1 deletion source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ Contents:

installation
administration
support

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

68 changes: 34 additions & 34 deletions source/installation/ha.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ our recommended configuration for production utilization of Private
Chef.

We refer to all the servers in a particular installation of Private Chef
as a cluster.
as a "cluster".

Overview
--------
Expand Down Expand Up @@ -170,7 +170,7 @@ Add the following line to your configuration file:

.. code-block:: ruby
topology “ha”
topology "ha"
This lets private chef know that these servers will be in a horizontally
scalable configuration with a highly-available back-end.
Expand All @@ -185,10 +185,10 @@ that server, add the following:

.. code-block:: ruby
server FQDN,
:ipaddress => IPADDRESS,
:role => backend,
:bootstrap => true
server "FQDN",
:ipaddress => "IPADDRESS",
:role => "backend",
:bootstrap => true
Replace ``FQDN`` with the fully-qualified domain name of the server, and
``IPADDRESS`` with the IP address of the server. The role is
Expand All @@ -201,18 +201,18 @@ For the other back-end server, add the following:

.. code-block:: ruby
server FQDN,
:ipaddress => IPADDRESS,
:role => backend
server "FQDN",
:ipaddress => "IPADDRESS",
:role => "backend"
Add an entry for the back-end vip which you assigned earlier:

*Create the back-end vip entry in private-chef.rb*

.. code-block:: ruby
backend_vip FQDN,
:ipaddress => IPADDRESS
backend_vip "FQDN",
:ipaddress => "IPADDRESS"
Replace ``FQDN`` with the fully-qualified domain name of the server, and
``IPADDRESS`` with the IP address of the VIP.
Expand All @@ -226,9 +226,9 @@ For each front-end server, add the following:

.. code-block:: ruby
server FQDN,
:ipaddress => IPADDRESS,
:role => frontend
server "FQDN",
:ipaddress => "IPADDRESS",
:role => "frontend"
Replace ``FQDN`` with the fully qualified domain name of the server, and
``IPADDRESS`` with the IP address of the server. The role is
Expand All @@ -243,7 +243,7 @@ Add the following line to your config file:

.. code-block:: ruby
api_fqdn FQDN
api_fqdn "FQDN"
Replace ``FQDN`` with the fully-qualified domain name of the load
balanced VIP.
Expand Down Expand Up @@ -272,34 +272,34 @@ Looks like this:

.. code-block:: ruby
topology “ha”
topology "ha"
server be1.example.com”,
:ipaddress => 192.168.4.1,
:role => backend,
server "be1.example.com"
:ipaddress => "192.168.4.1",
:role => "backend",
:bootstrap => true
server be2.example.com,
:ipaddress => 192.168.4.6,
:role => backend,
server "be2.example.com",
:ipaddress => "192.168.4.6",
:role => "backend",
:bootstrap => true
backend_vip be.example.com,
:ipaddress => 192.168.4.7
backend_vip "be.example.com",
:ipaddress => "192.168.4.7"
server fe1.example.com,
:ipaddress => 192.168.4.2,
:role => frontend
server "fe1.example.com",
:ipaddress => "192.168.4.2",
:role => "frontend"
server fe2.example.com,
:ipaddress => 192.168.4.3,
:role => frontend
server "fe2.example.com",
:ipaddress => "192.168.4.3",
:role => "frontend"
server fe3.example.com,
:ipaddress => 192.168.4.4,
:role => frontend
server "fe3.example.com",
:ipaddress => "192.168.4.4",
:role => "frontend"
api_fqdn chef.example.com
api_fqdn "chef.example.com"
Place the Private Chef package on the servers
---------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion source/installation/org_creation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ You will then be prompted to fill in a form with two fields:
- **Organization Full Name**: Should be the name of your company or department
- **Organizaiton Short Name**: Should be a lowercase word describing the organization - used in the Web UI and API URLs.

Once you have filled in the for, click *Create Organization* to create your organization.
Once you have filled in the form, click *Create Organization* to create your organization.

.. image:: ../images/create_org_button.png

Expand Down
54 changes: 27 additions & 27 deletions source/installation/tiered.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Availability installation rather than a tiered installation, if
possible.

We refer to all the servers in a particular installation of Private Chef
as a cluster.
as a "cluster".

Overview
--------
Expand Down Expand Up @@ -115,7 +115,7 @@ Add the following line to your configuration file:

.. code-block:: ruby
topology tier
topology "tier"
This lets private chef know that these servers will be in a horizontally
scalable configuration with a single, non-highly-available back-end.
Expand All @@ -129,9 +129,9 @@ For the server you will be using as the back-end, add the following:

.. code-block:: ruby
server FQDN,
:ipaddress => IPADDRESS,
:role => backend,
server "FQDN",
:ipaddress => "IPADDRESS",
:role => "backend",
:bootstrap => true
Replace ``FQDN`` with the fully-qualified domain name of the server, and
Expand All @@ -146,8 +146,8 @@ services. Let private chef know by adding the following entry:

.. code-block:: ruby
backend_vip FQDN,
:ipaddress => IPADDRESS
backend_vip "FQDN",
:ipaddress => "IPADDRESS"
Replace ``FQDN`` with the fully-qualified domain name of the server, and
``IPADDRESS`` with the IP address of the server.
Expand All @@ -161,9 +161,9 @@ For each front-end server, add the following:

.. code-block:: ruby
server FQDN,
:ipaddress => IPADDRESS,
:role => frontend
server "FQDN",
:ipaddress => "IPADDRESS",
:role => "frontend"
Replace ``FQDN`` with the fully qualified domain name of the server, and
``IPADDRESS`` with the IP address of the server. The role is
Expand All @@ -178,7 +178,7 @@ Add the following line to your config file:

.. code-block:: ruby
api_fqdn FQDN
api_fqdn "FQDN"
Replace ``FQDN`` with the fully-qualified domain name of the load
balanced VIP.
Expand All @@ -205,29 +205,29 @@ Looks like this:

.. code-block:: ruby
topology tier
topology "tier"
server be1.example.com,
:ipaddress => 192.168.4.1,
:role => backend,
server "be1.example.com",
:ipaddress => "192.168.4.1",
:role => "backend",
:bootstrap => true
backend_vip be1.example.com,
:ipaddress => 192.168.4.1
backend_vip "be1.example.com",
:ipaddress => "192.168.4.1"
server fe1.example.com,
:ipaddress => 192.168.4.2,
:role => frontend
server "fe1.example.com",
:ipaddress => "192.168.4.2",
:role => "frontend"
server fe2.example.com,
:ipaddress => 192.168.4.3,
:role => frontend
server "fe2.example.com",
:ipaddress => "192.168.4.3",
:role => "frontend"
server fe3.example.com,
:ipaddress => 192.168.4.4,
:role => frontend
server "fe3.example.com",
:ipaddress => "192.168.4.4",
:role => "frontend"
api_fqdn chef.example.com
api_fqdn "chef.example.com"
Place the Private Chef package on the servers
---------------------------------------------
Expand Down
Loading

0 comments on commit e49e473

Please sign in to comment.