0

i am running this playbook, but its failing at last task. running this from ubuntu host,,

---
 - hosts: all
   become: yes
   tasks:
   - name: Copy certificate files.
     copy:
        src: "{{ item.src }}"
        dest: "{{ item.dest }}"
        owner: root
        group: root
        mode: 0644
     with_items:
     -  {  src: "/registry_certs/domain.crt", dest: "/usr/local/share/ca-certificates/ca.crt" }

   - command: sudo apt-get install --reinstall ca-certificates
   - command: sudo update-ca-certificates

   - name:  "just force systemd to reread configs (2.4 and above)"
     systemd:
       name: "{{ item }}"
       state: started
       daemon_reload: yes
     with_items:
     - docker
     - kubelet

error

ubuntu@kops:/etc/ansible$ sudo ansible-playbook certificate_new.yml -l aws  --syntax-check
ERROR! no action detected in task

The error appears to have been in '/etc/ansible/certificate_new.yml': line 18, column 6, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


   - name:  "just force systemd to reread configs (2.4 and above)"
     ^ here
  • I don't think this question has anything to do with Unix & Linux and it already has an answer (Reason #1) on StackOverflow. – techraf Mar 4 '18 at 10:45
-1

As per Ansible syntax, after tasks:, you need to indent - name: and the other tasks bellow, one space more as in:

---
 - hosts: all
   become: yes
   tasks:
    - name: Copy certificate files.
  • This is blatantly wrong. YAML does not require this and by no means it is a reason for the error in the question. – techraf Mar 4 '18 at 10:42
  • well then whats the solution fot this balantly wrong error,,bcoz its the error which is being thrown – Mohammed Ali Mar 6 '18 at 12:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.