From ee539057a3e7387b95736dc85bd4d9af5c8e552c Mon Sep 17 00:00:00 2001 From: Srdjan Grubor Date: Tue, 14 Jan 2014 15:42:34 -0600 Subject: Added code that can run sudo tasks and install turbine/transifex client --- ansible/playbooks/setup_dev_machine.yaml | 17 ----------------- ansible/playbooks/setup_dev_machine_root.yaml | 17 +++++++++++++++++ ansible/playbooks/setup_dev_machine_user.yaml | 17 +++++++++++++++++ ansible/playbooks/setup_jhbuild.yaml | 11 ++++++++--- ansible/playbooks/setup_other_tools.yaml | 18 ++++++++++++++++++ ansible/setup_dev_machine.sh | 5 +++-- 6 files changed, 63 insertions(+), 22 deletions(-) delete mode 100644 ansible/playbooks/setup_dev_machine.yaml create mode 100644 ansible/playbooks/setup_dev_machine_root.yaml create mode 100644 ansible/playbooks/setup_dev_machine_user.yaml create mode 100644 ansible/playbooks/setup_other_tools.yaml (limited to 'ansible') diff --git a/ansible/playbooks/setup_dev_machine.yaml b/ansible/playbooks/setup_dev_machine.yaml deleted file mode 100644 index 3ffe699..0000000 --- a/ansible/playbooks/setup_dev_machine.yaml +++ /dev/null @@ -1,17 +0,0 @@ ---- -# vim:ff=unix ts=2 sw=2 ai expandtab - -### -# Notice the minus on the line below -- this starts the playbook's record -# in the YAML document. Only one playbook is allowed per YAML file. Indent -# the body of the playbook. -- - hosts: dev_machine - - sudo: False - - vars_files: - - "../default_variables.yaml" - - tasks: - - include: setup_jhbuild.yaml diff --git a/ansible/playbooks/setup_dev_machine_root.yaml b/ansible/playbooks/setup_dev_machine_root.yaml new file mode 100644 index 0000000..8a6f5df --- /dev/null +++ b/ansible/playbooks/setup_dev_machine_root.yaml @@ -0,0 +1,17 @@ +--- +# vim:ff=unix ts=2 sw=2 ai expandtab + +### +# Notice the minus on the line below -- this starts the playbook's record +# in the YAML document. Only one playbook is allowed per YAML file. Indent +# the body of the playbook. +- + hosts: dev_machine + + sudo: True + + vars_files: + - "../default_variables.yaml" + + tasks: + - include: setup_other_tools.yaml diff --git a/ansible/playbooks/setup_dev_machine_user.yaml b/ansible/playbooks/setup_dev_machine_user.yaml new file mode 100644 index 0000000..3ffe699 --- /dev/null +++ b/ansible/playbooks/setup_dev_machine_user.yaml @@ -0,0 +1,17 @@ +--- +# vim:ff=unix ts=2 sw=2 ai expandtab + +### +# Notice the minus on the line below -- this starts the playbook's record +# in the YAML document. Only one playbook is allowed per YAML file. Indent +# the body of the playbook. +- + hosts: dev_machine + + sudo: False + + vars_files: + - "../default_variables.yaml" + + tasks: + - include: setup_jhbuild.yaml diff --git a/ansible/playbooks/setup_jhbuild.yaml b/ansible/playbooks/setup_jhbuild.yaml index 3df6a63..fdbb0c0 100644 --- a/ansible/playbooks/setup_jhbuild.yaml +++ b/ansible/playbooks/setup_jhbuild.yaml @@ -3,17 +3,22 @@ - name: "Ensuring that git is installed" apt: name=git + - name: "Creating checkout directory" file: path=~/checkout state=directory mode=755 + - name: "Cloning jhbuild" git: repo=git://git.gnome.org/jhbuild dest=~/checkout/jhbuild -- name: "Installing jhbuildi - autogen" +- name: "Installing jhbuild - autogen" shell: cd ~/checkout/jhbuild && ./autogen.sh -- name: "Installing jhbuildi - make" +- name: "Installing jhbuild - make" shell: cd ~/checkout/jhbuild && make -- name: "Installing jhbuildi - make install" +- name: "Installing jhbuild - make install" shell: cd ~/checkout/jhbuild && make install + +- name: "Creating glib schemas dir" + file: path=~/install/share/glib-2.0/schemas state=directory mode=755 diff --git a/ansible/playbooks/setup_other_tools.yaml b/ansible/playbooks/setup_other_tools.yaml new file mode 100644 index 0000000..ef7eec6 --- /dev/null +++ b/ansible/playbooks/setup_other_tools.yaml @@ -0,0 +1,18 @@ +--- +# vim:ff=unix ts=2 sw=2 ai expandtab + +- name: "Ensuring that git is installed" + apt: name=git + +- name: "Creating turbine directory" + file: path=~/checkout state=directory mode=755 + +- name: "Cloning turbine" + git: repo=git://git.gnome.org/turbine + dest=~/checkout/turbine + +- name: "Installing turbine" + shell: cd ~/checkout/turbine && python setup.py install + +- name: "Installing transifex client" + shell: pip install transifex-client diff --git a/ansible/setup_dev_machine.sh b/ansible/setup_dev_machine.sh index 9387570..dc20084 100755 --- a/ansible/setup_dev_machine.sh +++ b/ansible/setup_dev_machine.sh @@ -34,7 +34,8 @@ trap "rm -f $tmp_inventory" EXIT echo "Creating Ansible inventory file in $tmp_inventory" cat << EOF > $tmp_inventory [dev_machine] -dev_machine ansible_ssh_host=$TARGET_IP ansible_ssh_user="$TARGET_USER" ansible_ssh_pass="${TARGET_PASS}" ansible_connection=ssh +dev_machine ansible_ssh_host=$TARGET_IP ansible_ssh_user="$TARGET_USER" ansible_sudo_pass="${TARGET_PASS}" ansible_ssh_pass="${TARGET_PASS}" ansible_connection=ssh EOF -ansible-playbook -i $tmp_inventory playbooks/setup_dev_machine.yaml +ansible-playbook -i $tmp_inventory playbooks/setup_dev_machine_root.yaml +ansible-playbook -i $tmp_inventory playbooks/setup_dev_machine_user.yaml -- cgit v1.2.3