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

tries to install from channel stable instead of unstable #14

Open
epcim opened this issue Jun 28, 2018 · 0 comments
Open

tries to install from channel stable instead of unstable #14

epcim opened this issue Jun 28, 2018 · 0 comments

Comments

@epcim
Copy link

epcim commented Jun 28, 2018

  • when no pkg in stable ch.
  • when service_type=systemd
  • channel = unstable

throws

null_resource.hab-svc (habitat): ✓ Installed core/hab-sup/0.57.0/20180614232222
null_resource.hab-svc (habitat): ★ Install of core/hab-sup/0.57.0/20180614232222 complete with 13 new packages installed.
null_resource.hab-svc (habitat): sudo: unable to resolve host ctl01
null_resource.hab-svc (habitat): sudo: unable to resolve host ctl01
null_resource.hab-svc (habitat): sudo: unable to resolve host ctl01
null_resource.hab-svc (habitat): sudo: unable to resolve host ctl01
null_resource.hab-svc (habitat): » Installing epcim/etcd
null_resource.hab-svc (habitat): ☁ Determining latest version of epcim/etcd in the 'stable' channel


Error: Error applying plan:

1 error(s) occurred:

* null_resource.hab-svc: error executing "env HAB_NONINTERACTIVE=true sudo -E hab pkg install epcim/etcd": Process exited with status 1

Actually, a few iterations before, when "service_type was not specified" it did the installation from unstable without any issues. Seems as nondeterministic but that's even more strange right?

Actual code:

resource "null_resource" "hab-svc" {

  depends_on = ["openstack_compute_floatingip_associate_v2.terraform"]

  connection {
    type = "ssh"
    user = "ubuntu"
    host = "${element(openstack_compute_floatingip_v2.management.*.address, count.index)}"
    private_key = "${file("${var.ssh_key_file}")}"
  }

  # upload certificates
  provisioner "local-exec" {
    command = "mkdir ./tmp; cp -v ./cfssl/*vault*.pem ./tmp"
  }
  provisioner "remote-exec" {
    inline = [
      "sudo mkdir -p /hab/svc/etcd/files",
      "sudo mkdir -p /hab/svc/vault/files",
      "sudo chown -R $USER.$USER /hab"
    ]
  }
  provisioner "file" {
    source      = "./tmp/"
    destination = "/hab/svc/etcd/files"
  }
  provisioner "file" {
    source      = "./tmp/"
    destination = "/hab/svc/vault/files"
  }

  provisioner "habitat" {
    peer = "${openstack_compute_instance_v2.ctl.0.access_ip_v4}"
    use_sudo = true
    service_type = "systemd"
    permanent_peer = true

    service {
      name      = "epcim/etcd"
      topology  = "leader"
      user_toml = "${file("../etcd/env/vault-etcd.${var.tag_env}.toml")}"
      channel   = "unstable"
      strategy  = "rolling"
      group     = "${var.tag_namespace}"
    }

    service {
      name      = "epcim/vault"
      topology  = "leader"
      user_toml = "${file("../vault/env/default.${var.tag_env}.toml")}"
      channel   = "unstable"
      binds     = ["storage:etcd.${var.tag_namespace}"]
      strategy  = "at-once"
      #strategy  = "rolling"
      group     = "${var.tag_namespace}"
    }

  }

  provisioner "remote-exec" {
  # connection {
  #   host = "${element(openstack_compute_floatingip_v2.management.*.address, count.index)}"
  #   user     = "${var.ssh_user_name}"
  #   private_key = "${file(var.ssh_key_file)}"
  # }

   inline = [
     "sudo apt-get -y update",
   ]
  }

}
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

No branches or pull requests

1 participant