-
Notifications
You must be signed in to change notification settings - Fork 6
Configuration
Mu's configuration is stored in mu.yaml
. An exhaustive list of options can be found here.
Simple gem-based Mu installations will look for ~/.mu.yaml
in the home of the invoking user.
If you've installed a dedicated Mu Master, the main systemwide Mu configuration will be in /opt/mu/etc/mu.yaml
. Non-root users on dedicated Mu Masters can customize some variables in their own personal ~/.mu.yaml
files.
This file can be edited directly, but it's typically operated on by using mu-configure
.
mu-configure
is a menu-driven command line utility used to edit your mu.yaml
file. During a manual full installation, you will be prompted by mu-configure
for initial setup parameters:
1) Public Address - REQUIRED
2) Admin Email - REQUIRED
3) Admin Name - Mu Administrator (DEFAULT)
4) Local Hostname - REQUIRED
5) Momma Cat Listen Port - 2260 (DEFAULT)
6) Banner - Mu Master at stange-mu-dev (DEFAULT)
7) Mu Tools Repository - git://github.com/cloudamatic/mu.git (DEFAULT)
8) Additional Repositories - ["https://github.com/cloudamatic/mu_demo_platform"] (DEFAULT)
9) Mu Master Runlist Extras
10) Invade Foreign VPCs? - false (DEFAULT)
11) Ansible directory
12) Amazon Web Services
13) Google Cloud Platform
14) Microsoft Azure Cloud Computing Platform & Services
Only Public Address
, Admin Email
, and Local Hostname
are required during initial installation. Note that Public Address
can be, but is not always, the local machine's first IP address. This field may also be a hostname, an aliased public IP exposed by a cloud provider, or the address of a load balancer or proxy server.
In a gem-based installation, Mu will attempt to autodetect as much configuration as possible, but in most circumstances you will need to run mu-configure
to add cloud provider credentials.
Most options are also exposed as switches, for use with no-menu mode (-n
). See mu-configure --help
for details.
1) Default Target Account
2) Default Region - us-east-1 (DEFAULT)
3) Credentials Vault:Item
4) Credentials File
5) Access Key
6) Access Secret
7) Log and Secret Bucket Name - REQUIRED
8) Is Default - false (DEFAULT)
9) Name - REQUIRED
Unless Mu is installed on an AWS instance which has, via an Instance Profile, working administrative API credentials, you will need to retrieve an Access Key and a Secret from an appropriate IAM user and provide them to Mu.
- Create a user in the IAM Console, being sure to check the
Programmatic access
box when doing so. - In the permissions pane, either assign the user to a group with administrative access, or use the
Attach existing policies directly
option to attach theAdministratorAccess
policy. - Tag and review the account as desired, then create it
- Retrieve the access key and secret from the next page. Note that the latter will not be retrievable again. If necessary, you can edit the user to add a new key/secret pair later.
These credentials can be inserted into Mu in any of several ways:
- If in a Chef environment (such as a full Mu Master install), create a vault item with
access_key
andaccess_secret
elements, likeknife vault create myawsacct creds '{ "access_key": "foo", "access_secret": "bar" }'
. Then, using the menu options inmu-configure
, selectCredentials Vault:Item
and point it to your new credentials. - Insert the raw
Access Key
andAccess Secret
strings using thosemu-configure
menu options/ - Use the
Credentials File
option with a path to an awscli style credentials .ini file.
The Google subsection of the mu-configure
menu:
1) Default Project - REQUIRED
2) Credentials Vault:Item
3) Credentials File
4) Base64-Encoded Credentials
5) Default Region - us-east4 (DEFAULT)
6) Log and Secret Bucket Name - REQUIRED
7) GSuite Masquerade User
8) GSuite Customer ID
9) Is Default Account - false (DEFAULT)
11) Name - REQUIRED
The Google Cloud layer uses the credentials of a GCP Service Account. Navigate to the Service Accounts page of the GCP console in your project, and choose Create Service Account
. Under most circumstances, you will want to grant Project => Owner
permissions to this service account. Be sure to select Create Key
(JSON), which should generate and automatically download a JSON file with service credentials.
These credentials can be inserted into Mu in any of several ways:
- If in a Chef environment (such as a full Mu Master install), create a vault from the JSON credentials file, e.g.
knife vault create secrets google -J my-google-service-account.json
. Then set theCredentials Vault:Item
option. - Place the JSON credentials file in a file and set the path to that file with the
Credentials File
option. - Base64 encode the contents of the JSON credentials file, perhaps with the
base64
utility, then select theBase64-Encoded Credentials
option and paste the resulting string.
If you are in a GSuite or Cloud Identity organization, with multiple projects, choose or create a project intended for long-term administrative use when creating your service account. You can later grant access to multiple projects one of several ways:
- Grant domain-wide access to Mu by selecting your whole organization from the drop-down menu at the top of the page. Go to the
IAM
pane and add the service account user from your administrative project to the domain. You may also wish to addResource Manager => Organization Administrator
, if Mu will be expected to have full dominion over all organization resources. - Navigate to a folder which contains projects which Mu will be permitted to manage. Go to the
IAM
pane and add the service account user from your administrative project to this folder (and thus all child folders/projects), with theProject => Owner
role. You may also wish to addResource Manager => Folder Admin
, if Mu will be creating and deleting folders. - Navigate to each individual project which Mu will be permitted to manage. Go to the
IAM
pane and add the service account user from your administrative project to this project, with theOwner
role.
Mu can also manage GSuite-level GCP resources, such as users and groups. This requires a special delegation of directory-level privileges to Mu's GCP service account. Certain folder and project management API calls also require this delegation.
These instructions are intended for GSuite customers. While they are also applicable to Cloud Identity domains, Oauth delegation does not seem to work consistently with Cloud Identity. Investigation with Google Support is ongoing.
- On the
Service Accounts
management tab, click on your service account to view its details. In theUnique ID
field, there should be a long numeric string. Save this string. - As a GSuite domain administrative user, log into admin.google.com. Choose
Security
, theSingle Sign On
, and look for theEntity ID
field. The value afteridpid= in the URL there should be the
Customer ID`. Save this string. - Using
mu-configure
, fill in theGSuite Customer ID
value with the string obtained in step 2, and theGSuite Masquerade User
value with the email address of a GSuite user in this organization with appropriate domain privileges. - Now, as a GSuite domain administrative user, navigate to the Oauth Client Management page. In the
Client Name
field, enter the service account unique ID we saved in step 1. In theAPI Scopes
field, enter the following list of scopes:
https://www.googleapis.com/auth/admin.directory.group.member, https://www.googleapis.com/auth/admin.directory.group, https://www.googleapis.com/auth/admin.directory.user, https://www.googleapis.com/auth/admin.directory.domain, https://www.googleapis.com/auth/admin.directory.orgunit, https://www.googleapis.com/auth/admin.directory.rolemanagement, https://www.googleapis.com/auth/admin.directory.customer, https://www.googleapis.com/auth/admin.directory.user.alias, https://www.googleapis.com/auth/admin.directory.userschema, https://www.googleapis.com/auth/admin.directory.group.member.readonly, https://www.googleapis.com/auth/admin.directory.group.readonly, https://www.googleapis.com/auth/admin.directory.user.readonly, https://www.googleapis.com/auth/admin.directory.domain.readonly, https://www.googleapis.com/auth/admin.directory.orgunit.readonly, https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly, https://www.googleapis.com/auth/admin.directory.customer.readonly, https://www.googleapis.com/auth/admin.directory.user.alias.readonly, https://www.googleapis.com/auth/admin.directory.userschema.readonly
To only grant Mu read-only access to organization-level resources, you can instead use:
https://www.googleapis.com/auth/admin.directory.group.member.readonly, https://www.googleapis.com/auth/admin.directory.group.readonly, https://www.googleapis.com/auth/admin.directory.user.readonly, https://www.googleapis.com/auth/admin.directory.domain.readonly, https://www.googleapis.com/auth/admin.directory.orgunit.readonly, https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly, https://www.googleapis.com/auth/admin.directory.customer.readonly, https://www.googleapis.com/auth/admin.directory.user.alias.readonly, https://www.googleapis.com/auth/admin.directory.userschema.readonly
The Azure subsection of the mu-configure
menu:
1) Directory ID
2) Client ID
3) Client Secret
4) Default Subscription
5) Credentials File
6) Default Region - eastus (DEFAULT)
7) Is Default Account - false (DEFAULT)
9) Name - REQUIRED
We'll need a Directory ID
, Client ID
, Client Secret
, and Subscription
for credentials with sufficient privileges to create and destroy resources will be required. These can be entered directly, or saved in a JSON file with the values in a hash (keys directory_id
, client_id
, client_secret
, subscription
).
Azure credentials can be retrieved from the Azure web portal.
-
subscription
- A GUID string (ex.8ba83ef5-96f3-8bc1-c16f-55b8950c4f8e
). Can be retrieved from the Subscriptions page. -
directory_id
- A GUID string. Can be retrieved from the Azure Active Directory Properties page.
We suggest creating a Managed Identity for Mu's application credentials. When creating, be sure to retrieve and save the client_secret
, which can only be accessed once. Then, return to the Subscriptions page and select your subscription to reach its dashboard. From there, Access control (IAM)
, and choose Add a role assignment
to grant Mu subscription-wide administrator privileges so that it can create and delete resources, modify users, etc.