Order of notify handlers

I think you may have “restart docker” listed before “daemon reload” in your handlers file. That part of the ansible documentation is a bit misleading. It means that handlers are executed in the order they are written in the handlers file, not the order they are notified. This is little more clear in the documentation: … Read more

Ansible and Wget

Don’t use shell-module when there is specialized modules available. In your case: Create directories with file-module: – name: create project directory {{ common.project_dir }} file: state=directory path={{ common.project_dir }} Download files with get_url-module: – name: download sources get_url: url={{ opencv.url }} dest={{ common.project_dir }}/{{ opencv.file }} Note the new module call syntax in the examples … Read more

How to create new system service by ansible-playbook

The below code snippet will create Service in CentOS 7. Code Tasks /tasks/main.yml – name: TeamCity | Create environment file template: src=teamcity.env.j2 dest=/etc/sysconfig/teamcity – name: TeamCity | Create Unit file template: src=teamcity.service.j2 dest=/lib/systemd/system/teamcity.service mode=644 notify: – reload systemctl – name: TeamCity | Start teamcity service: name=teamcity.service state=started enabled=yes Templates /templates/teamcity.service.j2 [Unit] Description=JetBrains TeamCity Requires=network.target After=syslog.target … Read more

Ansible: variable interpolation in task name

Variables are not resolved inside the name. Only inside the actual tasks/conditions etc. the placeholders will be resolved. I guess this is by design. Imagine you have a with_items loop and use the {{ item }}in the name. The tasks name will only be printed once, but the {{ item }} would change in every … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)