Giter VIP home page Giter VIP logo

ansible-for-devops's Introduction

ansible-for-devops's People

Contributors

agentolivia avatar akasurde avatar alishahrudi avatar arashpath avatar arbabnazar avatar brain2life avatar dglinder avatar fatpixel avatar fgierlinger avatar geerlingguy avatar githuberik avatar hippogriffin avatar jonleibowitz avatar lihop avatar misse avatar mkrawczuk avatar mtlynch avatar noplanman avatar q0rban avatar redmar-van-den-berg avatar rm avatar samycoenen avatar torenware avatar victorkane avatar weshouman avatar z3dm4n avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ansible-for-devops's Issues

[Chapter 8 - lamp stack] Error with galaxy module geerlingguy.repo-epel

Hi,
I am facing this issue when trying to use your galaxy module for epel repo.
The error is in italian but I'm sure you can understand it aswell:

TASK [geerlingguy.repo-epel : Install EPEL repo.] ******************************
fatal: [192.168.2.2]: FAILED! => {"changed": true, "failed": true, "msg": "Errore: Niente da fare\n", "rc": 1, "results": ["Plugin abilitati:fastestmirror\nImpostazione processo di installazione\nAnalisi di /var/tmp/yum-root-hSO8yJ/epel-release-latest-6.noarch.rpm: epel-release-6-8.noarch\n/var/tmp/yum-root-hSO8yJ/epel-release-latest-6.noarch.rpm: non aggiorna il pacchetto installato.\n"]}

Please note that I face the same error with modules from other people too (from ansible galaxy)
Anyway, if I ssh in the machine I can find the repo installed, so maybe:

  • that repo is already present in your vagrant box and the module cant' handle this situation
  • the module actually adds the repo and then fails somehow

Thanks, bye

Simple Docker example is throwing deprecation warnings

In Travis builds and locally, when running Ansible 2.3+:

[DEPRECATION WARNING]: docker is kept for backwards compatibility but usage is 
discouraged. The module documentation details page may explain more about this 
rationale..
This feature will be removed in a future release. Deprecation warnings can be disabled
by setting deprecation_warnings=False in ansible.cfg.

See: http://docs.ansible.com/ansible/docker_module.html

Basically, this should be split into docker_container and docker_image usage.

Ansible Common Roles Question

I'm not sure if this is the right place to ask a question regarding a topic in the Ansible for DevOps book. If not I'd be happy to ask it in another more appropriate forum.

I'm wondering what the purpose of the "Common" role in Ansible is. I see it referenced often and it is usually a sibling of "webtier" and "monitoring" roles (https://docs.ansible.com/playbooks_best_practices.html). How should I conceptualize the "common" role? Do the webtier and monitoring roles share, pull or import data from the common role? Is there any way to see a detailed example of an already built common role?

For chapter 3 can't connect to vms through

After following the setup guide on page 68 to 72, I can't seem to be able to connect or ping the created vms through their private network ips. My problem is similar to https://leanpub.com/ansible-for-devops/feedback#comment-2101413414 or this one but neither of the solution provided their is working for me.

I am using:

  • OS X El Capitan
  • Virtualbox: Version 5.0.26 r108824
  • Vagrant 1.8.5
  • ansible 2.1.0.0

I do suspect that there is something wrong with the vagrant box cause I've tried other boxes(e.g.scotch/box) with the same vagrant file configuration and the private ips works fine.

Please, any help or guidance will be really appreciated. Also, let me know if you need more information about my setup.

Thanks,

Incorrect `image_id` for `provisioners/digital_ocean.yml` in Chapter 8

First off, love the book! Have really enjoyed working my way through it.

One small note, I'm getting the error Failure talking to yum: Cannot retrieve repository metadata (repomd.xml) for repository: varnish-4.1. Please verify its path and try again" when trying to run provision.yml in the Chapter 8 Lamp Infrastructure Digital Ocean example. I believe the issue is that the digital ocean image_id in provisioners/digital_ocean.yml is 'centos-6-5-x32'. However, there is no x32 image for Varnish (based on my understanding of https://repo.varnish-cache.org/redhat/varnish-4.1/el6/). There is however an x64 image.

This error can be fixed by updating the image_id to centos-6-5-x64.

Thanks again for a fantastic book!

please include a license

Hi

I would like to reuse parts of your playbooks and I noticed that this repository doesn't have a license included although the README mentions BSD/MIT. Is this a dual license? BSD itself has several different variants and not all of them have the same functional terms.. Please include a specific license with the repository. Thank you!

Dynamic inventory with groups?

Hi :)

You've showed how to create digital ocean droplets , but add_hosts doesn't generate inventory file. Dynamic inventory file won't have groups which you've specified on digital ocean playbook. So I'm completely puzzled how to create dynamic inventory file, which would move droplets to certains groups. Without this I can't do deployment of certain groups. Also as without having groups we can't do anything at all with ansible. The only way I've would to accomplish this, is to modify digital_ocean.py dynamic inventory file, so that it would seek for "group=" variable in user-data, thought digital ocean API. User-data would be filled with group variable, when creating droplet.

lamp-infrastructure fails to setup mysql slave

When I run the vagrant up for the lamp-infrastructure example It completes successfully but doesn't setup the mysql slave instance.

Environment:
ansible 1.8.2
Vagrant 1.6.3

If I re-run the playbook:

ansible-playbook configure.yml -i inventories/vagrant/inventory -u vagrant --private-key=~/.vagrant.d/insecure_private_key

I get the following errors:

TASK: [geerlingguy.mysql | Check slave replication status.] *******************
skipping: [192.168.2.5]
failed: [192.168.2.6] => {"failed": true}
msg: Server is not configured as mysql slave
...ignoring

...

TASK: [geerlingguy.mysql | Configure replication on the slave.] ***************
skipping: [192.168.2.5]
failed: [192.168.2.6] => {"failed": true, "parsed": false}
SUDO-SUCCESS-jsqcdcjyncxfohjolqzdpxleconmwwvd
Change master
Traceback (most recent call last):
  File "/home/vagrant/.ansible/tmp/ansible-tmp-1429224404.57-222078884447207/mysql_replication", line 1949, in <module>
    main()
  File "/home/vagrant/.ansible/tmp/ansible-tmp-1429224404.57-222078884447207/mysql_replication", line 367, in main
    changemaster(cursor, chm, chm_params)
  File "/home/vagrant/.ansible/tmp/ansible-tmp-1429224404.57-222078884447207/mysql_replication", line 165, in changemaster
    cursor.execute(query, chm_params)
  File "/usr/lib64/python2.6/site-packages/MySQLdb/cursors.py", line 173, in execute
    self.errorhandler(self, exc, value)
  File "/usr/lib64/python2.6/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
_mysql_exceptions.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''106'' at line 1")

Add custom index.html file for balancer example

This is great. I think it would be great if you had a custom index.html used which would provide the IP# of the backend webserver it loads. This way it can visually show which of the backend webserver it loaded.

I noticed in one of your other examples you did something like this; but doing it for this example would be the best.

Didn't realize this wouldn't display for the deployments-balancer folder specifically

Long options in examples == self documenting

Love the book so far. One suggestion I would like to make is to use long options instead of short options when possible. This has the benefit of teaching me what the commands do.

An example is:
ansible example --args="free --mega" --user=[username]

instead of:
ansible example -a "free -m" -u [username]

In the long option example I can get some useful information out of the command without having to look at a man page. I can imply that free --mega might mean megabytes where as with free -m I thought it just meant memory.

I would be happy to help contribute to overhauling the book to improve all the examples with more readable, self-documenting long options.

Node js forever doesn't install properly

When I run the node js example, forever doesn't properly install. Vagrant 1.8.1/ansible 2.0.0.2

TASK [Check list of running Node.js apps.] *************************************
fatal: [192.168.60.7]: FAILED! => {"changed": false, "cmd": "forever list", "failed": true, "invocation": {"module_args": {"_raw_params": "forever list", "_uses_shell": false, "chdir": null, "creates": null, "executable": null, "removes": null, "warn": true}, "module_name": "command"}, "msg": "[Errno 2] No such file or directory", "rc": 2}

I updated the forever installation to use the command module instead of npm and it works properly.

  • name: Install Forever (to run our Node.js app).
    command: "npm install forever -g"

screen shot 2016-01-27 at 9 09 11 pm

Drupal playbook error

Syntax error on the following play:

  - name: Enable upload progress via APC.
    lineinfile:
      dest: "/etc/php5/conf.d/20-apc.ini"
      regexp: "^apc\.rfc1867"
      line: "apc.rfc1867 = 1"
      state: present
    notify: restart apache

Aborts playbook on vagrant up and on successive vagrant provision calls:

$ vagrant provision
==> default: Running provisioner: ansible...
ERROR: Syntax Error while loading YAML script, provisioning/playbook.yml
Note: The error may actually appear before this position: line 95, column 21

      dest: "/etc/php5/conf.d/20-apc.ini"
      regexp: "^apc\.rfc1867"
                    ^
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

Should task names be declarative rather than imperative

Hi, Jeff

I've noticed that you use a declarative style in task names at the beginning of your book, but then the "human-purposed" texts become imperative, why?

Ansible holds for idempotency which one can't be achieved imperatively and proper tasks (not command and shell ones) tries not to change the state without the need. I agree with you in proper describing of what the task actually do, but maybe it should be done through out the book?

Problem with Vagrantfile in Ch 3, pg 20 (hard copy)

I think there's an issue with the Vagrantfile in Ch 03, page 20 of the print edition.

The private network config lines, as is, kick off this error on my MBP (running yosemite)

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

ARPCHECK=no /sbin/ifup eth1 2> /dev/null

Stdout from the command:

ERROR    : [/etc/sysconfig/network-scripts/ifup-eth] Device eth1 does not seem to be present, delaying initialization.


Stderr from the command:

If I change it to

app.vm.network :private_network, ip: "192.168.60.4", auto_config: false

It works.

Just figured something for the errata perhaps! Seems like it's limited to centos7 from some limited testing I've done.

/includes/provisioning/vars.yml ==> 8.x or 8.0.x?

In /includes/provisioning/vars.yml:

This doesn't seem to work:
drupal_core_version: "8.x"

This works fine:
drupal_core_version: "8.0.x"

The "drupal" project has "8.0.x" in it, so I'm guessing there was a typo transposing.

nodejs fails to install node on CentOS

Following directions in nodejs/README.md I'm getting:

TASK: [Install Node.js and npm.] **********************************************
failed: [default] => {"changed": false, "failed": true, "rc": 0, "results": []}
msg: **No Package matching 'npm' found available, installed or updated**

FATAL: all hosts have already failed -- aborting

Seems to be a problem with EPEL? BTW, the EPEL repo task, and all tasks prior to this one, complete successfully.

At this point the playbook aborts of course.

Add automated test integration with Travis CI

I have it for almost all upstream projects... so it would be good to have at least a spot-check of each configuration run via Travis CI.

  • deployments
  • deployments-balancer
  • deployments-rolling
  • docker
  • drupal
  • dynamic-inventory
  • includes
  • jenkins
  • lamp-infrastructure
  • nodejs
  • nodejs-role
  • orchestration
  • solr

Have to set gather_facts = false in digitalocean provision.yml playbook to get it to work on first run

In provision.yml for the digitalocean inventory example, it currently works if you run the playbook twice. It'll provision the droplet on the first run, but will fail while trying to gather facts during the first run. On the 2nd run, it'll be able to gather facts, so it'll pass, then keep running through the playbooks tasks.

The task in the 2nd half of the playbook to wait_for ssh to come up doesn't seem to apply before gather_facts is called. Unfortunately, I didn't find a way to delay gathering_facts with a "wait_for" or anything like that - so I think it'll always fail the first time provision.yml is called. I believe to get the provision.yml to work with the first time, gather_facts needs to be false in both places.

This works works for me. Setting gather_facts: true doesn't seem to work for me:

  • hosts: do
    remote_user: root
    gather_facts: false

    tasks:

    • name: Wait for port 22 to become available.
      local_action: "wait_for port=22 host={{ inventory_hostname }}"

==> Is there a way to set a gather_facts delay?
image

`rolling-deploy` example relies on `nodejs_forever` which was removed from `geerlingguy.nodejs`

I was working my way through the rolling-deploy example and noticed that any commands involving forever failed with 'No such file or directory'. I then noticed that this commit to geerlingguy.nodejs removed the nodejs_forever variable. However, rolling-deploy still sets nodejs_forever: true in provision.yml to install forever.

What is the best way to installforever with the newest version of the geerlingguy.nodejs role.

Thanks for an awesome book :)

'nodejs-role' lacks README and Vagrantfile

Also, it fails the "Common: Install EPEL and Remi repos." task.

TASK [Common: Install EPEL and Remi repos.] ************************************
failed: [default] (item={u'creates': u'/etc/yum.repos.d/remi.repo', u'href': u'http://rpms.famillecollet.com/enterprise/remi-release-6.rpm'}) => {"changed": true, "cmd": ["rpm", "-Uvh", "--force", "http://rpms.famillecollet.com/enterprise/remi-release-6.rpm"], "delta": "0:00:00.823621", "end": "2017-05-13 02:42:13.042741", "failed": true, "item": {"creates": "/etc/yum.repos.d/remi.repo", "href": "http://rpms.famillecollet.com/enterprise/remi-release-6.rpm"}, "rc": 1, "start": "2017-05-13 02:42:12.219120", "stderr": "error: Failed dependencies:\n\tepel-release = 6 is needed by remi-release-6.8-2.el6.remi.noarch", "stderr_lines": ["error: Failed dependencies:", "\tepel-release = 6 is needed by remi-release-6.8-2.el6.remi.noarch"], "stdout": "Retrieving http://rpms.famillecollet.com/enterprise/remi-release-6.rpm", "stdout_lines": ["Retrieving http://rpms.famillecollet.com/enterprise/remi-release-6.rpm"]}

Dependency conflict php roles

Learning Ansible, so not sure how to deal with this. While running the tasks that install and configure PHP, this error appears:

TASK [geerlingguy.php : Ensure PHP packages are installed.] ********************
failed: [192.168.2.3](item=[u'php', u'php-cli', u'php-common', u'php-devel', u'php-fpm', u'php-gd', u'php-imap', u'php-ldap', u'php-mbstring', u'php-opcache', u'php-pdo', u'php-pear', u'php-pecl-apc', u'php-xml', u'php-xmlrpc']) => {"changed": true, "failed": true, "item": ["php", "php-cli", "php-common", "php-devel", "php-fpm", "php-gd", "php-imap", "php-ldap", "php-mbstring", "php-opcache", "php-pdo", "php-pear", "php-pecl-apc", "php-xml", "php-xmlrpc"], "msg": "Error: php-pecl-zendopcache conflicts with php-pecl-apc-3.1.9-2.el6.x86_64\n", "rc": 1,

I'm Running Ansible 2.0.2.0 and Vagrant 1.8.1

Error when installing Django via easy_install, but works using pip

Running on Ubuntu Mate 16.04, with Centos 7 as guest OS.

I came upon an error when installing Django in Chapter 3, "Configure the Application servers". The command ansible app -s -m easy_install -a "name=django" failed. Logging into one of the app servers and running the command directly gave the following error.

[vagrant@orc-app2 ~]$ easy_install django
Traceback (most recent call last):
  File "/usr/bin/easy_install", line 9, in <module>
    load_entry_point('setuptools==0.9.8', 'console_scripts', 'easy_install')()
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 378, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2566, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2260, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 49, in <module>
    from setuptools.package_index import PackageIndex
  File "/usr/lib/python2.7/site-packages/setuptools/package_index.py", line 14, in <module>
    from setuptools import ssl_support
  File "/usr/lib/python2.7/site-packages/setuptools/ssl_support.py", line 85, in <module>
    from backports.ssl_match_hostname import CertificateError, match_hostname
ImportError: No module named ssl_match_hostname

Running ansible app -s -m pip -a "name=django" installed Django correctly.

'deployments' README.md incorrect

README.md for 'deployments' section may be incorrect at the following line:

Run ansible-galaxy install -r requirements.yml in this directory to get the required Ansible roles.

vagrant up after performing the aforementioned step had the following result:

ERROR! the role 'geerlingguy.git' was not found in /Users/gallagherpolyn/ansible/ansible-for-devops/deployments/playbooks/roles:/Users/gallagherpolyn/ansible/ansible-for-devops/deployments/playbooks:/Users/gallagherpolyn/ansible/ansible-for-devops/deployments

The error appears to have been in '/Users/gallagherpolyn/ansible/ansible-for-devops/deployments/playbooks/provision.yml': line 9, column 7, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

  roles:
    - geerlingguy.git
      ^ here

The following command works, instead, but may break Ansible best practices:

ansible-galaxy install --roles-path=playbooks/roles -r requirements.yml

Question: Role documentation, standards or best practices?

First of all, thanks and gratitude for writing that extremely helpful and very well written book, Jeff.

I don't know whether this issue queue is the appropriate place to ask about something that isn't example related, and not specifically covered in the book, but I couldn't think of a better place to ask.

My question is related to a role that I intend to share via Galaxy (installing / configuring hiawatha webserver incl. virtual hosts -- the few available roles don't work for me). But the question is, I think, of more general interest (at least for me):

What is the best place to document role variables, tasks, etc.?

There are several ways to go about this, that I can think of:

  • Should we just add documentation in the README file?
  • Should we add comments in the defaults/main.yml and tasks/main.yml? (And if so, are there standards for this that allow documentation to be extracted?)
  • Should we add documentation (markdown) files that we link to from the README file? (And if so, are there standards for how to name these files and for where to place them?)
  • Should we add external documentation by creating or linking to (for example) a ReadTheDocs project?

Or is there another, better or preferred way/place to do this, that I haven't found about yet?

"unsupported parameter for module: gather_timeout" error while trying to provision vm in "nodejs" directory

Hello
I've got following error while trying to provision playbook in "nodejs" directory
"unsupported parameter for module: gather_timeout"
repo cloned from https://github.com/geerlingguy/ansible-for-devops/

I'm running latest ansible @ Debian 7 x64

root@CORE:/home/acid/ansible-for-devops/nodejs# ansible --version
ansible 2.3.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/usr/share/ansible']

Command output

root@CORE:/home/acid/ansible-for-devops/nodejs# vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'geerlingguy/centos7'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'geerlingguy/centos7' is up to date...
==> default: Setting the name of the VM: nodejs_default_1478705892057_88717
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Configuring and enabling network interfaces...
==> default: Running provisioner: ansible...
    default: Running ansible-playbook...

PLAY [all] *********************************************************************

TASK [Gathering Facts] *********************************************************
fatal: [default]: FAILED! => {"changed": false, "failed": true, "msg": "unsupported parameter for module: gather_timeout"}
        to retry, use: --limit @/home/acid/ansible-for-devops/nodejs/provisioning/playbook.retry

PLAY RECAP *********************************************************************
default                    : ok=0    changed=0    unreachable=0    failed=1

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

I'm newbie in ansible, any ideas how to fix such kind of errors?
Maybe I should try different ansible version? No idea how to install it.

Thank you

`ansible up` == default: Warning: Connection timeout. Retrying...

Host Ubuntu 14.04, ansible 2.2.0.0, vboxmanage 4.3.36_Ubuntur105129

When doing an ansible up I get a

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'geerlingguy/centos7'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'geerlingguy/centos7' is up to date...
==> default: Setting the name of the VM: vagrant_default_1488056506230_50292
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...

This answer to use the GUI prompt to choose default|safe mode does get me past that stage. http://stackoverflow.com/a/22575302/292408.

config.vm.provider :virtualbox do |vb|
  vb.gui = true
end

In addition vagrant ssh doesn't appear to work, not sure if it is related or not.

digitalocean provisioning doesn't work

The first time you run it, it fails with the following error

"SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh"

If you add the key to the host, a second run works however. This might be related to

ansible/ansible#9442

[Chapter 8 - lamp stack] Error copying varnish default.vcl

Hi,
no matter what I try, I keep getting this error:

fatal: [192.168.2.2]: FAILED! => {"changed": false, "failed": true, "invocation": {"module_args": {"dest": "/etc/varnish/default.vcl", "src": "templates/default.vcl.j2"}, "module_name": "template"}, "msg": "AnsibleUndefinedVariable: 'host' is undefined"}

Can you help ? Thanks

Please note I am following your book at chapter 8.

NodeJS Role example: missing role subdirectory

Page 98 of the book (version 0.95) mentions that the structure for the nodejs-role example should be:

  • app/
    • app.js
    • package.json
  • playbook.yml
  • roles/
    • nodejs/
      • meta/
        • main.yml
      • tasks/
        • main.yml

From what I can see however, the directory ansible-for-devops/nodejs-role/ is completely missing the roles subdirectory.
Am I missing something obvious here or does the repository simply not contain the subdirectory due to an omission?

drupal playbook: /etc/php5/apache2/conf.d/20-apcu.ini does not exist

I encountered the below problem and was able to reproduce it and verify that in fact the file is not present.

...
TASK [Install Apache, MySQL, PHP, and other dependencies.] *********************
changed: [default] => (item=[u'git', u'curl', u'sendmail', u'apache2', u'php5', u'php5-common', u'php5-mysql', u'php5-cli', u'php5-curl', u'php5-gd', u'php5-dev', u'php5-mcrypt', u'php-apc', u'php-pear', u'python-mysqldb', u'mysql-server'])

TASK [Disable the firewall (since this is for local dev only).] ****************
changed: [default]

TASK [Start Apache, MySQL, and PHP.] *******************************************
ok: [default] => (item=apache2)
ok: [default] => (item=mysql)

TASK [Enable Apache rewrite module (required for Drupal).] *********************
changed: [default]

TASK [Add Apache virtualhost for Drupal 8 development.] ************************
changed: [default]

TASK [Symlink Drupal virtualhost to sites-enabled.] ****************************
changed: [default]

TASK [Remove default virtualhost file.] ****************************************
changed: [default]

TASK [Enable upload progress via APC.] *****************************************
fatal: [default]: FAILED! => {"changed": false, "failed": true, "msg": "Destination /etc/php5/apache2/conf.d/20-apcu.ini does not exist !", "rc": 257}

RUNNING HANDLER [restart apache] ***********************************************

PLAY RECAP *********************************************************************
default                    : ok=11   changed=7    unreachable=0    failed=1

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

Using find from /:

root@vagrant:/# find . -name '*apcu*'
./etc/php5/cli/conf.d/20-apcu.ini
./etc/php5/cgi/conf.d/20-apcu.ini
./etc/php5/mods-available/apcu.ini
./usr/lib/php5/20121212/apcu.so
./usr/include/php5/ext/apcu
./usr/share/doc/php5-apcu
./usr/share/php/.registry/.channel.pecl.php.net/apcu.reg
./var/lib/php5/modules/cli/enabled_by_maint/apcu
./var/lib/php5/modules/cgi/enabled_by_maint/apcu
./var/lib/php5/modules/registry/apcu
./var/lib/dpkg/info/php5-apcu.md5sums
./var/lib/dpkg/info/php5-apcu.postrm
./var/lib/dpkg/info/php5-apcu.conffiles
./var/lib/dpkg/info/php5-apcu.prerm
./var/lib/dpkg/info/php5-apcu.list
./var/lib/dpkg/info/php5-apcu.postinst
./var/cache/apt/archives/php5-apcu_4.0.10-1+deb.sury.org~precise+1_amd64.deb
root@vagrant:/#

Unsure which of the files this is supposed to be actioned against. I'm assuming both cli and cgi since I'd imagine one dir is for CLI invocation of php and the other is for apache?

lamp-infrastructure fails on varnish due to timeout

Fails to install varnish with commands:

git clone https://github.com/geerlingguy/ansible-for-devops.git
cd ansible-for-devops/lamp-infrastructure
sudo ansible-galaxy install -r requirements.yml
vagrant up

when running the lamp-infrastructure on macOS 10.12 with Ansible 2.2.0.0 and vagrant 1.9.1 with "vagrant up" Ansible fails to install Rails:

TASK [geerlingguy.varnish : Install Varnish.] ********************************** fatal: [192.168.2.2]: FAILED! => {"changed": true, "failed": true, "msg": "https://repo.varnish-cache.org/redhat/varnish-4.1/el6/x86_64/varnish/varnish-4.1.4-1.el6.x86_64.rpm: [Errno 12] Timeout on https://repo.varnish-cache.org/redhat/varnish-4.1/el6/x86_64/varnish/varnish-4.1.4-1.el6.x86_64.rpm: (28, 'Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds')\nTrying other mirror.\n\n\nError Downloading Packages:\n varnish-4.1.4-1.el6.x86_64: failure: varnish/varnish-4.1.4-1.el6.x86_64.rpm from varnish-4.1: [Errno 256] No more mirrors to try.\n\n", "rc": 1, "results": ["Loaded plugins: fastestmirror\nSetting up Install Process\nLoading mirror speeds from cached hostfile\n * epel: mirror.steadfast.net\nResolving Dependencies\n--> Running transaction check\n---> Package varnish.x86_64 0:4.1.4-1.el6 will be installed\n--> Processing Dependency: jemalloc for package: varnish-4.1.4-1.el6.x86_64\n--> Processing Dependency: libjemalloc.so.1()(64bit) for package: varnish-4.1.4-1.el6.x86_64\n--> Running transaction check\n---> Package jemalloc.x86_64 0:3.6.0-1.el6 will be installed\n--> Finished Dependency Resolution\n\nDependencies Resolved\n\n================================================================================\n Package Arch Version Repository Size\n================================================================================\nInstalling:\n varnish x86_64 4.1.4-1.el6 varnish-4.1 1.7 M\nInstalling for dependencies:\n jemalloc x86_64 3.6.0-1.el6 epel 100 k\n\nTransaction Summary\n================================================================================\nInstall 2 Package(s)\n\nTotal download size: 1.8 M\nInstalled size: 6.6 M\nDownloading Packages:\n"]}

Looks like: https://repo.varnish-cache.org/redhat/varnish-4.1/el6/x86_64/varnish/varnish-4.1.4-1.el6.x86_64.rpm is inaccessible and there's no mirrors for it to find an alt. Maybe this is just transient?

"includes" example fails provisioning

TASK [Add ondrej repository for later versions of PHP.] ************************
fatal: [default]: FAILED! => {"changed": false, "failed": true, "msg": "failed to fetch PPA information, error was: HTTP Error 404: Not Found"}

cannot find roles in deployment of nodejs

when I run vagrant for the deployment of nodejs, this error appeared, would you please fix it.

ERROR: cannot find role in /Users/lythaihoa2311992/ansible_tutorial/ansible-for-devops/deployments/playbooks/roles/geerlingguy.git or /Users/lythaihoa2311992/ansible_tutorial/ansible-for-devops/deployments/playbooks/geerlingguy.git or /etc/ansible/roles/geerlingguy.git Ansible failed to complete successfully. Any error output should be visible above. Please fix these errors and try again.

nodejs: forever is not installed

Following the nodejs example I get the error:

TASK [Check list of running Node.js apps.] *************************************
fatal: [default]: FAILED! => {"changed": false, "cmd": "forever list", "failed": true, "msg": "[Errno 2] No such file or directory", "rc": 2}

Further invocations of vagrant provision produce the same error and interestingly the "Install Forever (to run our Node.js app)" task is marked as changed every time. I logged into the machine and found out forever wasn't being installed at all.

Changing the "Install Forever" task so that state=present rather than state=latest fixes the problem.
However, my understanding is that state=latest should also ensure the package is installed so maybe this is a bug in the ansible npm module?

I am using Ansible version: 2.0.0.

Django needs python 2.7

Following the instructions, python 2.6 is installed, however django 1.8 requires 2.7.

Installing django with easy_install will result in this error:

Traceback (most recent call last):
  File "/usr/bin/easy_install", line 9, in <module>
    load_entry_point('distribute==0.6.10', 'console_scripts', 'easy_install')()
  File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 1715, in main
    with_ei_usage(lambda:
  File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 1696, in with_ei_usage
    return f()
  File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 1719, in <lambda>
    distclass=DistributionWithoutHelpCommands, **kw
  File "/usr/lib64/python2.6/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/lib64/python2.6/distutils/dist.py", line 975, in run_commands
    self.run_command(cmd)
  File "/usr/lib64/python2.6/distutils/dist.py", line 995, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 236, in run
    self.easy_install(spec, not self.no_deps)
  File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 472, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 502, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 681, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 958, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 947, in run_setup
    run_setup(setup_script, args)
  File "/usr/lib/python2.6/site-packages/setuptools/sandbox.py", line 29, in run_setup
    lambda: execfile(
  File "/usr/lib/python2.6/site-packages/setuptools/sandbox.py", line 70, in run
    return func()
  File "/usr/lib/python2.6/site-packages/setuptools/sandbox.py", line 31, in <lambda>
    {'__file__':setup_script, '__name__':'__main__'}
  File "setup.py", line 32, in <module>
  File "/tmp/easy_install-wlw1To/Django-1.8/django/__init__.py", line 1, in <module>
  File "/tmp/easy_install-wlw1To/Django-1.8/django/utils/version.py", line 7, in <module>
  File "/tmp/easy_install-wlw1To/Django-1.8/django/utils/lru_cache.py", line 28
    fasttypes = {int, str, frozenset, type(None)},
                    ^
SyntaxError: invalid syntax

Installing with pip will work, but then execution will fail with the same error.

Drupal example provisioning fails

TASK [Install Drupal.] *********************************************************
fatal: [default]: FAILED! => {"changed": true, "cmd": ["drush", "si", "-y", "--site-name=Drupal Test", "--account-name=admin", "--account-pass=admin", "--db-url=mysql://drupaltest:1234@localhost/drupaltest"], "delta": "0:00:00.195786", "end": "2017-05-11 00:12:07.375858", "failed": true, "rc": 255, "start": "2017-05-11 00:12:07.180072", "stderr": "PHP Fatal error:  Class Symfony\\Component\\Console\\Style\\SymfonyStyle contains 4 abstract methods and must therefore be declared abstract or implement the remaining methods (Symfony\\Component\\Console\\Output\\OutputInterface::isQuiet, Symfony\\Component\\Console\\Output\\OutputInterface::isVerbose, Symfony\\Component\\Console\\Output\\OutputInterface::isVeryVerbose, ...) in /var/www/drupal-8.2.x-dev/vendor/symfony/console/Style/SymfonyStyle.php on line 33\n [error]  Drush command terminated abnormally due to an unrecoverable error.\nError: Class Symfony\\Component\\Console\\Style\\SymfonyStyle contains 4 abstract methods and must therefore be declared abstract or implement the remaining methods (Symfony\\Component\\Console\\Output\\OutputInterface::isQuiet, Symfony\\Component\\Console\\Output\\OutputInterface::isVerbose, Symfony\\Component\\Console\\Output\\OutputInterface::isVeryVerbose, ...) in /var/www/drupal-8.2.x-dev/vendor/symfony/console/Style/SymfonyStyle.php, line 33 ", "stderr_lines": ["PHP Fatal error:  Class Symfony\\Component\\Console\\Style\\SymfonyStyle contains 4 abstract methods and must therefore be declared abstract or implement the remaining methods (Symfony\\Component\\Console\\Output\\OutputInterface::isQuiet, Symfony\\Component\\Console\\Output\\OutputInterface::isVerbose, Symfony\\Component\\Console\\Output\\OutputInterface::isVeryVerbose, ...) in /var/www/drupal-8.2.x-dev/vendor/symfony/console/Style/SymfonyStyle.php on line 33", " [error]  Drush command terminated abnormally due to an unrecoverable error.", "Error: Class Symfony\\Component\\Console\\Style\\SymfonyStyle contains 4 abstract methods and must therefore be declared abstract or implement the remaining methods (Symfony\\Component\\Console\\Output\\OutputInterface::isQuiet, Symfony\\Component\\Console\\Output\\OutputInterface::isVerbose, Symfony\\Component\\Console\\Output\\OutputInterface::isVeryVerbose, ...) in /var/www/drupal-8.2.x-dev/vendor/symfony/console/Style/SymfonyStyle.php, line 33 "], "stdout": "", "stdout_lines": []}

I know nothing about Drupal so I'm kind of useless at debugging this. I can tell you that changing drupal_core_version to other tags in the 8.2.x branch didn't help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.