<commit_before>resource "digitalocean_droplet" "mail" {
  image = "centos-7-x64"
  name = "mail"
  region = "${var.region}"
  size = "2gb"
  private_networking = true
  ssh_keys = [
    "${var.ssh_fingerprint}"
  ]

  connection {
    user = "root"
    type = "ssh"
    private_key = "${file("${var.pvt_key}")}"
    timeout = "2m"
  }

  provisioner "file" {
    source = "modules/iptables/files/config.sh"
    destination = "/tmp/iptables_config.sh"
  }

  provisioner "file" {
    source = "modules/docker/files/sysconfig_docker"
    destination = "/tmp/docker"
  }

  # Section getting
  provisioner "remote-exec" {
    inline = [
      # Configure firewall iptables
      "systemctl disable firewalld",
      "yum install -y iptables-services",
      "systemctl enable iptables",
      "chmod u+x /tmp/iptables_config.sh",
      "/tmp/iptables_config.sh",
      # Docker
      "yum install -y docker",
      "mv /tmp/docker /etc/sysconfig/docker",
      "chkconfig docker on",
      "systemctl restart docker",
      "curl -L \"https://github.com/docker/compose/releases/download/1.10.0/docker-compose-$(uname -s)-$(uname -m)\" -o /usr/local/bin/docker-compose",
      "chmod +x /usr/local/bin/docker-compose",
      # Mailcow
      "systemctl disable postfix",
      "systemctl stop postfix",
      "yum install -y git",
      "git clone https://github.com/andryyy/mailcow-dockerized",
      "cd ~/mailcow-dockerized && export MAILCOW_HOSTNAME=mail.rehab.earth; export TZ=\"Europe/London\"; ./generate_config.sh",
      "cd ~/mailcow-dockerized/ && docker-compose up -d"
    ]
  }
}<commit_msg>Adding Chef basics to Terraform<commit_after>resource "digitalocean_droplet" "mail" {
  image = "centos-7-x64"
  name = "mail"
  region = "${var.region}"
  size = "2gb"
  private_networking = true
  ssh_keys = [
    "${var.ssh_fingerprint}"
  ]

  connection {
    user = "root"
    type = "ssh"
    private_key = "${file("${var.pvt_key}")}"
    timeout = "2m"
  }

  provisioner "file" {
    source = "modules/iptables/files/config.sh"
    destination = "/tmp/iptables_config.sh"
  }

  provisioner "file" {
    source = "modules/docker/files/sysconfig_docker"
    destination = "/tmp/docker"
  }

  # Set up chef. No chef-client --local provisioner yet
  provisioner "remote-exec" {
    inline = [
      # Chef + Dependencies
      "curl -L https://omnitruck.chef.io/install.sh | sudo bash",
      "yum install -y git",
      "cd && git clone https://github.com/Klazomenai/rehab.earth.git",
      "cd ~/rehab.earth",
      "chef-client --local",
      # Configure firewall iptables
      "systemctl disable firewalld",
      "systemctl enable iptables",
      "chmod u+x /tmp/iptables_config.sh",
      "/tmp/iptables_config.sh",
      # Docker
      "yum install -y docker",
      "mv /tmp/docker /etc/sysconfig/docker",
      "chkconfig docker on",
      "systemctl restart docker",
      "curl -L \"https://github.com/docker/compose/releases/download/1.10.0/docker-compose-$(uname -s)-$(uname -m)\" -o /usr/local/bin/docker-compose",
      "chmod +x /usr/local/bin/docker-compose",
      # Mailcow
      "systemctl disable postfix",
      "systemctl stop postfix",
      "cd && git clone https://github.com/andryyy/mailcow-dockerized",
      "cd ~/mailcow-dockerized && export MAILCOW_HOSTNAME=mail.rehab.earth; export TZ=\"Europe/London\"; ./generate_config.sh",
      "cd ~/mailcow-dockerized/ && docker-compose up -d",
    ]
  }
}
{'fraction_non_alphanumeric': 0.1550771021239453, 'fraction_numerical': 0.00523712540005819, 'mean_word_length': 2.7167567567567565, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6750659', 'n_tokens_mistral': 1271, 'n_tokens_neox': 1211, 'n_words': 238}