Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REALM discovery aids cleanup #310

Merged
merged 2 commits into from
Sep 29, 2013
Merged

REALM discovery aids cleanup #310

merged 2 commits into from
Sep 29, 2013

Conversation

joshbronson
Copy link
Contributor

Realms now have access to a cluster_suffix helper that can be used as
follows.

Ironfan.realm(:p1) do
  # declaration
  cluster(:control)

  # implementation
  cluster(cluster_suffix(:control)) do
    # ...
  end
end

cluster_suffix(suffix) always returns suffix: it is the identity
function with a twist. The twist is that it will ensure that the
cluster exists within the realm. This is to ward off typos.

In addition, components now have access to a cluster_name helper that
can be used as follows.

Ironfan.realm(:p1) do
  # declaration
  cluster(:control)

  # implementation
  cluster(cluster_prefix(:control)) do
    facet(:nfs) do
      # ...
      nfs_server
      # ...
    end

    facet(:zabbix) do
      # ...
      nfs_client{ of cluster_name(:control) }
      # ...
    end
  end
end

In this case, in addition to ensuring that the :control cluster exists
within this realm, cluster_name(:control) returns the full name of the
cluster: :p1_control.

I've discovered that this style is preferable to using method calls (e.g., cluster_name.control).

These changes also contain fixes that allow cloud settings for realms to be correctly resolved into their clusters!

Realms now have access to a cluster_suffix helper that can be used as
follows.

```
Ironfan.realm(:p1) do
  # declaration
  cluster(:control)

  # implementation
  cluster(cluster_suffix(:control)) do
    # ...
  end
end
```

cluster_suffix(suffix) always returns suffix: it is the identity
function with a twist. The twist is that it will ensure that the
cluster exists within the realm. This is to ward off typos.

In addition, components now have acccess to a cluster_name helper that
can be used as follows.

```
Ironfan.realm(:p1) do
  # declaration
  cluster(:control)

  # implementation
  cluster(cluster_prefix(:control)) do
    facet(:nfs) do
      # ...
      nfs_server
      # ...
    end

    facet(:zabbix) do
      # ...
      nfs_client{ of cluster_name(:control) }
      # ...
    end
  end
end
```

In this case, in addition to ensuring that the :control cluster exists
within this realm, cluster_name(:control) returns the full name of the
cluster: :p1_control.
@temujin9 temujin9 merged commit cb1d9b5 into master Sep 29, 2013
@joshbronson joshbronson deleted the jbro_realms branch November 11, 2013 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants