Roots Discourse

'AnsibleUnicode' object has no attribute 'get_groups' during ansible deploy

Long-time Sage developer, but new to the Ansible playbooks and Trellis/Bedrock.

I’m deploying to Kinsta using the instructions here.

When I deploy to remove servers, I’m getting the following error:

[WARNING]: Failure using method (v2_playbook_on_play_start) in callback plugin
(<ansible.plugins.callback.vars.CallbackModule object at 0x7fa5d80ced90>):
‘AnsibleUnicode’ object has no attribute ‘get_groups’

The deploy seems to succeed, but I’m uncertain what is causing this error or how to diagnose. Any Ansible gurus out there?

Please share the contents of wordpress_sites.yml and vault.yml

As I’m having the exact same issue on my staging env(also deploying on Kinsta)

Here are the contents of wordpress_sites.yml and vault.yml (which is encrypted)

# wordpress_sites.yml
    wordpress_sites:
      mykinstasite.com:
        site_hosts:
          - canonical: url.kinsta.cloud
            # redirects:
            #   - otherdomain.com
        local_path: ../site # path targeting local Bedrock site directory (relative to Ansible root)
        repo: git@github.com:phil-wpks/myrepo.git # replace with your Git repo URL
        repo_subtree_path: site # relative path to your Bedrock/WP directory in your repo
        branch: master
        multisite:
          enabled: false
        ssl:
          enabled: false
          provider: letsencrypt
        cache:
          enabled: false

vault
       mykinstasite.com:
        env:
          db_user: mykinstadbuser
          db_name: mykinstaname
          db_password: mypwd
          # Generate your keys here: https://roots.io/salts.html
 auth_key: "thesalt"
      secure_auth_key: "thesalt"
      logged_in_key: "thesalt"
      nonce_key: "thesalt"
      auth_salt: "thesalt"
      secure_auth_salt: "thesalt"
      logged_in_salt: "thesalt"
      nonce_salt: "thesalt"

Thanks for your help, I’m not 100% confident in my Trellis config

Having the same issue (Ansible plugin callback error / warning during Kinsta deploy), did you find out what it was about?

I am having the same issue.

[WARNING]: Failure using method (v2_playbook_on_play_start) in callback plugin (<ansible.plugins.callback.vars.CallbackModule object at 0x10ecae970>): ‘AnsibleUnicode’ object has no attribute ‘get_groups’

After that I get a bunch of skipped tasks:

skipping: no hosts matched
skipping: [kinsta_staging] => {
"changed": false,
"skip_reason": "Conditional result was False"}

etc.
Ending with:

kinsta_staging : ok=2 changed=0 unreachable=0 failed=0 skipped=8 rescued=0 ignored=0

I am using:

ansible 2.9.2
config file = /Users/myusername/Desktop/bedrock_site/my_site/trellis/ansible.cfg
configured module search path = [’/Users/myusername/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]
ansible python module location = /usr/local/lib/python3.9/site-packages/ansible
executable location = /usr/local/bin/ansible
python version = 3.9.6 (default, Jun 29 2021, 06:20:32) [Clang 12.0.0 (clang-1200.0.32.29)]

My wordpress_sites.yml file looks like this:

wordpress_sites:
my_site:
site_hosts:
- canonical: staging.my_site
redirects:
- www.staging.my_site
local_path: …/site
branch: master
repo: myrepo…
repo_subtree_path: site
multisite:
enabled: false
ssl:
enabled: false
provider: letsencrypt
cache:
enabled: false

My hosts/staging looks like:

kinsta_staging ansible_host=ip_address ansible_ssh_port=my_port ansible_ssh_extra_args=’-o StrictHostKeyChecking=no’
[staging]
kinsta_staging
[web]
kinsta_staging

I have validated all .yml files using a validator.
Anyone have any idea what is the issue? I’ve spent so much time trying to figure it out.