Hello,
I try to figure how I must to construct an ansible playbooks with 
install/delete commands where it's variable changes. 
For example  apt_repository,apt,yum... where state=present -> installed and 
state=absent --> deleted

If I create two ansible playbooks: delete.yml and install.yml. There are 
may be problem's like:
I added to installation someting, but don't change deletion

Example:

install.yml:

    ---
    - name: Add x2go repository
      apt_repository: repo='deb http://ppa.launchpad.net/x2go/stable/ubuntu 
precise main' state=present
      apt_repository: repo='deb-src 
http://ppa.launchpad.net/x2go/stable/ubuntu precise main' state=present
      when: ansible_os_family == "Debian"
      tags:
        - remote-access-x2go
    - name: Install x2go application
      apt: name=x2goserver update_cache=yes state=present
      apt: name=x2goserver-xsession update_cache=no state=present
      when: ansible_os_family == "Debian"
      tags:
        - remote-access-x2go


delete.yml:

    ---
    - name: Add x2go repository
      apt_repository: repo='deb http://ppa.launchpad.net/x2go/stable/ubuntu 
precise main' state=absent
      apt_repository: repo='deb-src 
http://ppa.launchpad.net/x2go/stable/ubuntu precise main' state=present
      when: ansible_os_family == "Debian"
      tags:
        - remote-access-x2go
    - name: Install x2go application
      apt: name=x2goserver update_cache=yes state=absent
      apt: name=x2goserver-xsession update_cache=no state=absent
      when: ansible_os_family == "Debian"
      tags:
        - remote-access-x2go

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/ed15fbfd-43db-4464-9fb4-b9ac9a07bd54%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to