Example of ansible compiling httpd playbook, ansibleplaybook

Source: Internet
Author: User

Example of ansible compiling httpd playbook, ansibleplaybook

The following is the content of the playbook. The process is as follows:

1. First, a total of 3 .tar.gz files are downloaded in the local directory of apr, apr-util, and httpd.

2. decompress the three files.

3. Install the pcre and pcre-devel dependency packages.

4. Compile and install apr.

5. Compile and install apr-util.

6. Compile and install httpd.

---        - hosts: all          tasks:                 - name: download apr,apr-util,httpd                  get_url: url="{{item}}" dest=/root/pkg/
with_items:
              - https://mirrors.tuna.tsinghua.edu.cn/apache/apr/apr-1.6.2.tar.gz
              - https://mirrors.tuna.tsinghua.edu.cn/apache/apr/apr-util-1.6.0.tar.gz
              - https://mirrors.tuna.tsinghua.edu.cn/apache/httpd/httpd-2.4.27.tar.gz
           delegate_to: localhost
           run_once: True
- unarchive: src="/root/pkg/{{item}}" dest=/root/ with_items: - httpd-2.4.27.tar.gz - apr-1.6.2.tar.gz - apr-util-1.6.0.tar.gz tags: unarchive - name: install pcre and pcre-devel yum: name="{{item}}" state=installed with_items: - pcre - pcre-devel
              - expat-devel - name: complie apr shell: cd /root/apr-1.6.2 && ./configure --prefix=/usr/local/apr && make && make install - name: complie apr-util shell: | cd /root/apr-util-1.6.0 ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr make && make install - name: complie httpd shell: | cd /root/httpd-2.4.27 ./configure --prefix=/usr/local/apache --sysconfdir=/etc/apache \ --enable-mpms-shared=all \ --with-z --with-pcre \ --with-apr=/usr/local/apr \ --with-apr-util=/usr/local/apr-util \ --with-mpm=event make && make install

After compilation, there are also a series of operations, such as setting the PATH environment variable, setting the man PATH, modifying the configuration file, and starting httpd. These are not too easy to put in.

 

Go back to the Linux series article outline: workshop!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.