--- - name: Get the meta package for the couchbase repository get_url: url=http://packages.couchbase.com/releases/couchbase-release/couchbase-release-1.0-2-amd64.deb dest=/root/couchbase-release-1.0-2-amd64.deb register: couchbase_repository tags: couchbase - name: Install the package source and the Couchbase public keys shell: /usr/bin/dpkg -i /root/couchbase-release-1.0-2-amd64.deb when: ( couchbase_repository | changed ) tags: couchbase - name: Install the latest version of couchbase community server apt: pkg={{ item }} state=latest update_cache=yes with_items: - couchbase-server-community when: - couchbase_install_packages tags: couchbase - name: Ensure couchbase is started and enabled service: name=couchbase-server state=started enabled=yes when: couchbase_start_server tags: couchbase - name: Ensure couchbase is stopped and disabled service: name=couchbase-server state=stopped enabled=no when: not couchbase_start_server tags: couchbase