{
  "variables": {
    "project_id": null,
    "source_image": null,
    "machine_type": null
  },
  "builders": [
    {
      "type": "googlecompute",
      "project_id": "{{user `project_id`}}",
      "image_name": "reddit-app-{{timestamp}}",
      "source_image": "{{user `source_image`}}",
      "zone": "europe-west1-b",
      "ssh_username": "appuser",
      "machine_type": "{{user `machine_type`}}",
      "image_description": "Homework 9 by Packer; image has Ruby",
      "disk_size": "15",
      "disk_type": "pd-standard",
      "network": "default",
      "tags": [
        "puma-server"
      ]
    }
  ],
  "provisioners": [
    {
      "type": "ansible",
      "playbook_file": "ansible/packer_reddit_app.yml"
    }
  ]
}

{
  "variables": {
    "project_id": null,
    "source_image": null,
    "machine_type": null
  },
  "builders": [
    {
      "type": "googlecompute",
      "project_id": "{{user `project_id`}}",
      "image_name": "reddit-app-{{timestamp}}",
      "source_image": "{{user `source_image`}}",
      "zone": "europe-west1-b",
      "ssh_username": "appuser",
      "machine_type": "{{user `machine_type`}}",
      "image_description": "Homework 9 by Packer; image has Ruby",
      "disk_size": "15",
      "disk_type": "pd-standard",
      "network": "default",
      "tags": [
        "puma-server"
      ]
    }
  ],
  "provisioners": [
    {
      "type": "ansible",
      "playbook_file": "ansible/packer_reddit_app.yml",
      "extra_arguments": "--tags=ruby"
    }
  ]
}

Use Ansible role with tags for Packer
Use Ansible role with tags for Packer
