Created
December 29, 2017 00:06
-
-
Save charandas/0585f2dc64e0baf276d3e9cd36e05238 to your computer and use it in GitHub Desktop.
Revisions
-
charandas revised this gist
Dec 29, 2017 . 1 changed file with 46 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,46 @@ storage: files: - filesystem: "root" path: "/etc/hostname" mode: 0644 contents: inline: ${hostname} - filesystem: "root" path: "/etc/hosts" mode: 0644 contents: inline: "127.0.0.1 ${hostname} localhost\n ::1 ${hostname} localhost" - filesystem: "root" path: "/opt/rancher/rancher.sh" mode: 0755 contents: inline: | #!/bin/sh set -e umask 077 ${registration_command} passwd: users: - name: core ssh_authorized_keys: - some key systemd: units: - name: register-rancher-agent.service enabled: true mask: false contents: | [Unit] Description=Setup rancher agent [Service] Type=oneshot ExecStart=/opt/rancher/rancher.sh RemainAfterExit=true [Install] WantedBy=multi-user.target -
charandas created this gist
Dec 29, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ function (rancher) { provider: { rancher: { api_url: rancher.api_url, access_key: rancher.access_key, secret_key: rancher.secret_key } }, resource: { rancher_environment: { target_environment: { name: rancher.environment, orchestration: "cattle" } }, rancher_registration_token: { registration_token: { count: "${local.count}", environment_id: "${rancher_environment.target_environment.id}", name: "registration_token", description: "Host registration token for specified environment" } }, data: { template_file: { container_config: { count: "${local.count}", template: '${file("./templates/rancher_agents/container-config.tpl")}', vars: { hostname: "${lookup(local.hosts, count.index)}", registration_command: "${element(rancher_registration_token.registration_token.*.command, count.index)}" } } } } } }