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

Add support for ssh_clear_authorized_keys #158

Merged
merged 1 commit into from
Oct 24, 2018
Merged

Conversation

Cbeck527
Copy link
Contributor

Happy Hacktoberfest! 🎃

Issue

#156

List of Changes Proposed

Add support for ssh_clear_authorized_keys

Testing Evidence

In [1]: from packerlicious import builder, provisioner, Template

In [2]: template = Template()

In [3]: template.add_builder(
   ...:         builder.AmazonEbs(
   ...:           access_key="...",
   ...:           secret_key="...",
   ...:           region = "us-east-1",
   ...:           source_ami="ami-fce3c696",
   ...:           instance_type="t2.micro",
   ...:           ssh_username="ubuntu",
   ...:           ami_name="packer {{timestamp}}",
   ...:           communicator="ssh",
   ...:           ssh_clear_authorized_keys=True))
Out[3]: <packerlicious.builder.AmazonEbs at 0x10e940ac8>

In [4]: print(template.to_json())
{
  "builders": [
    {
      "access_key": "...",
      "ami_name": "packer {{timestamp}}",
      "communicator": "ssh",
      "instance_type": "t2.micro",
      "region": "us-east-1",
      "secret_key": "...",
      "source_ami": "ami-fce3c696",
      "ssh_clear_authorized_keys": "true",
      "ssh_username": "ubuntu",
      "type": "amazon-ebs"
    }
  ]
}

packer also validates this template:

$ cat test.json
{
  "builders": [
    {
      "access_key": "...",
      "ami_name": "packer {{timestamp}}",
      "communicator": "ssh",
      "instance_type": "t2.micro",
      "region": "us-east-1",
      "secret_key": "...",
      "source_ami": "ami-fce3c696",
      "ssh_clear_authorized_keys": "true",
      "ssh_username": "ubuntu",
      "type": "amazon-ebs"
    }
  ]
}

$ packer version
Packer v1.3.1

$ packer validate test.json
Template validated successfully.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 5e7fd52 on Cbeck527:master into 56a30a1 on mayn:master.

@mayn mayn added this to the 1.1.0 milestone Oct 24, 2018
@mayn
Copy link
Owner

mayn commented Oct 24, 2018

@Cbeck527, thanks!

@mayn mayn merged commit 79d4ed4 into mayn:master Oct 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants