How often does the letter "a" occur in:
Q: Ansible multiple hosts in one role How do I write a single role and connect to different hosts as the script progresses? 
This is an example of what I would like to do, but I am getting an error as shown below.
ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.

The error appears to be in '/etc/ansible/roles/customer_setups/microlight/customer_app_template/tasks/main.yml': line 3, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

# tasks file for /etc/ansible/roles/customer_app_template
- hosts: synbill-apps
  ^ here


---
# tasks file for /etc/ansible/roles/customer_app_template
- hosts: synbill-apps
  tasks:
  - name: Clone syndicatebilling repository into a new customer app
    git:
      repo: git@bitbucket.org:xxxx/xxx.git
      version: syndicateBookings
      dest: /var/www/html/microlight
      force: yes
  - name: run npm install
    npm:
      path: /var/www/html/microlight
  - name: copy .env file
    copy:
      src: files/.env
      dest: /var/www/html/microlight/.env
  - name: create new app key
    command: chdir=/var/www/html/microlight adonis key:generate
  - name: migrate database
    command: chdir=/var/www/html/microlight adonis migration:run --force
  - name: start the app
    command: chdir=/var/www/html/microlight pm2 start server.js --name placeholder_domain
  - name: save the pm2 config
    command: chdir=/var/www/html/microlight pm2 save
- hosts: synbill-db
  - name: "Install Mysql Client package"
    apt:
      name: "{{ item }}"
      state: present
    with_items:
      - mysql-client
      - python3-dev
      - libmysqlclient-dev
      - python3-mysqldb
  - name: Create syndicate database
    mysql_db:
      name: microlight
      state: present
      login_user: simon
      login_password: xxxxxxxxxxx
- hosts: synbill-apps
  .....now the db is setup do some more work on the apps server
- hosts: synbill-webserver
  .... now setup the virtual host
- hosts: synbill-db
  .... now update the database to so user knows everything is setup.


A: The tasks in the tasks.yml file don't look like a good fit for a role abstraction. I would just write a playbook.
In order to be able to execute the playbook you will need to add a `tasks section here:
- hosts: synbill-db
  tasks:
  - name: "Install Mysql Client package"

To abstract the code with role(s) the easiest way I see, would be to write to write two roles, one for app and one for db.

user
There are 129 "a"s.
assistant