LoginSignup
22
23

More than 5 years have passed since last update.

AnsibleでProxyを一括設定する

Last updated at Posted at 2014-02-20

@garbagetownさんのあなたが Ansible を使うべき n 個の理由の記事中で

Redmine のインストール手順はネット上に山ほど転がっているけど、プロキシ設定など環境依存の落とし穴にハマる人は自分を含め相当数いる

とあって、自分も昔ハマっていたことを思い出しました。

分かると簡単なんだけど、yumやらwgetやらサーバ毎に設定するのは面倒なので、Proxyを一括設定するAnsibleのPlaybookを作りました(と言ってもかなり昔でAnsibleも1.2だったり。。)

ここで紹介しているAnsible-RedmineやAnsible-Gitlabの実行前に行うことでプロキシ環境下でもスムーズに進めることが出来ます。
以下、README.mdのコピペです。

ansible-Proxy

ansibleを使って、CentOSにプロキシの設定をします。

対象環境

CentOS 6.4 64bit (virtualbox + vagrantで構築)

実行環境

$ ansible --version  
ansible 1.2.2  

proxyの設定箇所

roles/proxy/vars/main.yml
https_proxy: "https://proxy.example.com:8080/"  
http_proxy: "http://proxy.example.com:8080/"  

proxyを設定するもの

  • bash
  • git
  • Ruby - gem
  • wget
  • curl
  • yum

実行手順(簡易版)

hosts内に対象サーバのIPアドレスを入力しておくこと。

git clone https://github.com/volanja/ansible-Proxy.git
cd ansible-Proxy
ansible-playbook setup.yml -i hosts

以上です。

22
23
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
22
23