Skip to content

Instantly share code, notes, and snippets.

@patrickmslatteryvt
Last active April 19, 2017 18:47
Show Gist options
  • Save patrickmslatteryvt/b8208b261f810dc427a07e59d0bc140c to your computer and use it in GitHub Desktop.
Save patrickmslatteryvt/b8208b261f810dc427a07e59d0bc140c to your computer and use it in GitHub Desktop.
ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.

The error:

(ansible_2.4.0) [pslattery@pslattery990 ansible-playbooks] $ ansible-playbook playbooks/dms-deploy-docker-gc.yaml --syntax-check
The error appears to have been in '/home/pslattery/source/stash/Automation/ansible-playbooks/playbooks/roles/mwg.docker-gc/tasks/deploy-docker-gc.yaml': line 37, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: "Pull the service image"
  ^ here

The file it is complaining about:

---
- name: "Create Docker-gc conf directory"
  file:
    path: "{{ item }}"
    state: directory
    owner: "{{ service_user }}"
    group: "{{ service_group }}"
    mode: "u=rwx,g=rwx,o=rx"
    recurse: yes
  with_items:
    - /data/{{ service_name }}

- name: "Deploy exclude files for Docker-gc"
  copy:
    src: "{{ item }}"
    dest: /data/{{ service_name }}/{{ item }}
    backup: no
    force: yes
    owner: "{{ service_user }}"
    group: "{{ service_group }}"
    mode: "u=rw,g=r,o=r"
  with_items:
    - exclude-containers
    - exclude-images
  ignore_errors: true

- name: "Deploy the unit file for the service"
  template:
    src: "{{ service_name }}.service"
    dest: /etc/systemd/system/{{ service_name }}.service
    backup: no
    owner: "{{ service_user }}"
    group: "{{ service_group }}"
    mode: "u=rw,g=r,o=r"
  register: template_result

- name: "Pull the service image"   # <----- error points here
  become: yes
  become_user: automation
  docker_image:
    state: present
    name: "{{ service_image }}"
    tag: latest

- name: "Deploy the timer unit file for the service"
  template:
    src: "{{ service_name }}.timer"
    dest: "/etc/systemd/system/{{ service_name }}.timer"
    backup: no
    owner: root
    group: root
    mode: "u=rw,g=r,o=r"
#    validate: systemd-analyze verify %s
  register: template_result

- name: "Enable and start the timer for the service"
  systemd:
    daemon_reload: yes
    name: "{{ service_name }}.timer"
    enabled: yes
    state: started
    masked: no
  when: template_result.changed == true
  register: systemd_result
  failed_when: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment